- C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(4453, 5): error MSB3030: Could not copy the file "bin\Release\myapp.exe.manifest" because it was not found.
- Project src\mysolution\myapp\myapp.csproj failed.
- Project src\mysolution\mysolution.sln failed.
It almost certainly happens when you are doing the following:
- Using msbuild directly, rather than Visual Studio "right click" (e.g. you are using Team City)
- Have a solution with a web application and some other application types (e.g. a console app)
- Are using the Target "Publish" to publish the website
For example, here are the TC settings that cause the problem for me:
I'm also using a solution that has this structure
- MySolution
- MyConsoleApp
- MyWebApp
MyWebApp has a publish profile setup called "PublishToDisk". If I build or publish from Visual studio, everything is fine. If I build from Team City, I get the errors above.
I've known the cause of the problem for ages. The blanket "Publish" target is being applied to every project in the solution that might be publishable. That includes my console application. My console app is not setup for publishing however, nor do I want it to be. I do, however, want it to be built during the Team City process, as the app will get copied elsewhere via the packaging process in later stages.
However the possible solutions are not so obvious. running msbuild separately on myConsoleApp.csproj and MyWebApp.csproj seems ridiculously inefficient. Making my console application a click once app just to stop a build failure seems equally silly. By far the best solution I've found is to edit your myconsoleapp.csproj file and add the following section
<PropertyGroup> <GenerateManifests>true</GenerateManifests> </PropertyGroup>
You can add this just before the ItemGroup for reference includes.
This should be enough to keep to allow your application to build without a load of very awkward feeling bodges.
Incidentally - this problem is one that occurs if you try to do this publishing process with Orchard via TC, so would solve that scenario too.