I want to have a virtual application inside a site. I have modified my ServiceDefinition.csdef
as
<OutputPath>
on the .csproj like this<ExcludeFoldersFromDeployment>bin\file1.dll;file3.csv</ExcludeFoldersFromDeployment>
. Detailed info here<publishUrl>bin\WebDeployDropLocation</publishUrl>
<Site name="Web" physicalDirectory="..\..\..\MyWebApp\bin\WebDeployDropLocation">
under <Sites>
. Documentation here.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.
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:)
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]" />