Ignore files in Windows Azure virtual application

前端 未结 4 582
执念已碎
执念已碎 2021-01-03 07:48

I want to have a virtual application inside a site. I have modified my ServiceDefinition.csdef as


        

        
相关标签:
4条回答
  • 2021-01-03 07:51
    1. Create a WebDeploy Profile
    2. Enlist all the files to exclude next to <OutputPath> on the .csproj like this<ExcludeFoldersFromDeployment>bin\file1.dll;file3.csv</ExcludeFoldersFromDeployment>. Detailed info here
    3. If you want, define a relative path for the publish drop location on the .pubxml file (generally found under Properties\PublishProfiles under the web project) such as <publishUrl>bin\WebDeployDropLocation</publishUrl>
    4. Provide the drop location to ServiceDefinitioin.csdef like this: <Site name="Web" physicalDirectory="..\..\..\MyWebApp\bin\WebDeployDropLocation"> under <Sites>. Documentation here.
    5. Publish the WebProject and verify the files, Create Package from the WebRole project.
    6. Edit the file name of the resulting .cspkg, change it to a .zip file to verify the contents
    0 讨论(0)
  • 2021-01-03 07:55

    Use the publish feature in the original website project that you want to become a virtual application. Publish into a separate folder in your filesystem as if it were going to be a website hosted by IIS on your system. The Publish feature will strip out all unnecessary files.

    Then in your .csdef file, use the path to your published site rather than to the folder your web project is in.

    0 讨论(0)
  • 2021-01-03 08:05

    I don't think you can tell visual studio to do it. It only does this for your role associated web site project. So what you can do is copy your output files to a special folder in post build event. and point your physical directory to that:)

    0 讨论(0)
  • 2021-01-03 08:12

    As a workaround, I created a Web Deployment Project. To exclude files in the output, you need to put

    <ExcludeFromPackageFiles Include="[your file]">
        <FromTarget>Project</FromTarget>
    </ExcludeFromPackageFiles>
    

    And in the ServiceDefinition.csdef I specified the output path for web deployment project

    <VirtualApplication name="MyVirtualApp" physicalDirectory="[output path of my web deployment project]" />
    
    0 讨论(0)
提交回复
热议问题