1

We have a c# framework (not .core) solution with several projects in it. It is build by TFS. Sometimes (not all the times) I got a build error:

error MSB3030: Could not copy the file "c:\BuildAgent_work\27\b\Console.Admin\Product.Admin.exe.manifest" because it was not found. [c:\BuildAgent_work\27\s\Console.Admin\Console.Admin.csproj]

The app.manifest file is added to the project Properties folder, and I checked it exists on buildagent source folder. I checked it is not exists on the binaries folder. I don't know why it is not copied there during the build.

In fact I don't know if I need this manifest thing at all. I think I don't. This whole thing was added to the project by one of my collegaue for a reason is unknown for me. Is it required to create publish package for web projects? In this case why it is required for a console project? For what reason is it added?

The msbuild parameters (for building the solution) are the following, and the [x] Clean option is checked in the TFS build solution step.

/p:OutDir=$(Build.BinariesDirectory) 
/p:GenerateProjectSpecificOutputFolder=true 
/p:DeployOnBuild=true /
p:PackageAsSingleFile=true 
/p:GenerateDocumentation=true  
/p:DisableAllVSGeneratedMSDeployParameter=true 
/t:Clean,Build,Publish 
/p:RunCodeAnalysis=$(CodeAnalysis.Run);CodeAnalysisRuleSet=$(CodeAnalysis.RuleSet).ruleset;CodeAnalysisIgnoreGeneratedCode=true 
/p:IncludeAppPool=true 
/p:PrecompileBeforePublish=true;EnableUpdateable=false
Zoltan Hernyak
  • 989
  • 1
  • 14
  • 35
  • I removed the app.manifest from the project, and got the same error message. :( Why? :( – Zoltan Hernyak Jul 08 '20 at 09:25
  • VS is not automatically run with ADMIN privileges. do code run if you execute the exe instead of from VS? To run VS create shortcut and then right click and select As Admin. It appears the project is called Console.Admin.csproj so I'm assuming it should be run as Admin. – jdweng Jul 08 '20 at 10:06
  • @Zoltan Hernyak Not get your response for several days, would you please share your latest information about this issue? – Hugh Lin Jul 13 '20 at 09:57
  • Oh. Sorry. This is not an ADMIN privileged project, and the problem is that it is build on TFS, got the error on it, not on the developer computer. VS has not included in this issue. – Zoltan Hernyak Jul 24 '20 at 13:43

1 Answers1

1

An application manifest is an XML file that describes and identifies the shared and private side-by-side assemblies that an application should bind to at run time. These should be the same assembly versions that were used to test the application. Application manifests may also describe metadata for files that are private to the application. You can refer to this document.

So, you first need to check in csproj for any additional operations on the manifest. When the MSBuild creates the publish files it copies files base on the build definition , you can try to edit the .csproj file as bellow which copied the relevant files. app.manifest is your file path .

<ItemGroup>
        <None Update="app.manifest">
          <CopyToOutputDirectory>Always</CopyToOutputDirectory>
        </None>
</ItemGroup>
Hugh Lin
  • 17,829
  • 2
  • 21
  • 25