So, here's how to omit the bin folder.
First of all, I would like to emphasize that all these msdeploy-related materials are for deploying web applications, and the bin folder seems to me to be deeply hardcoded inside. Therefore, if you want to get rid of this, you must do some dirty things. Which I did.
We need to slightly modify the $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets , so it's better to change it, but it is copied.
Steps:
1.Backup $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets (alternatively, you can install the MSBuild.Microsoft.VisualStudio.Web.targets package, redirect the csproj file to the Microsoft.WebApplication.targets file obtained from the package and work with it).
2. In $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplicaton.targets find the xml node that looks like <CopyPipelineFiles PipelineItems="@(FilesForPackagingFromProject)" (there are several of them, take one of the line ~ 2570 )
3. Comment on the node, replace it with the usual one, so in the end it will look like this:
<CreateItem Include="$(OutputPath)\**\*.*"> <Output TaskParameter="Include" ItemName="YourFilesToCopy" /> </CreateItem> <Copy SourceFiles="@(YourFilesToCopy)" DestinationFiles="@(YourFilesToCopy->'$(WPPAllFilesInSingleFolder)\%(RecursiveDir)%(Filename)%(Extension)')" />
Then
4. Your project Name.wpp.targets should not have FilesForPackagingFromProject , so it will look like this:
<PropertyGroup> <DeployAsIisApp>false</DeployAsIisApp> <IncludeSetAclProviderOnDestination>false</IncludeSetAclProviderOnDestination> </PropertyGroup> <ItemGroup> </ItemGroup> </Project>
What is it. Worked for me (tm), tested. Let me be honest, I do not like this approach, but that was the only way I got it to work as it should. It is up to you whether you will use it in your project or not.
My opinion is not to use msdeploy here - this is not a task for you.
It is better to write msbuild scripts from scratch or accept the bin folder and fight the framework again when the next setup is required.