MSBuild Failure When PrecompileBeforePublish is enabled

╄→гoц情女王★ 提交于 2019-12-23 02:07:23

问题


I'm using following command to compile a project using msbuild with pre compile enabled

msbuild C:\WebGoat.NET-master\WebGoat\WebGoat.NET.csproj /p:OutputPath=bin /p:DeployOnBuild=true /p:WebPublishMethod="FileSystem";PrecompileBeforePublish=true;EnableUpdateable=false;DebugSymbols=true /p:UseMerge=true;WDPMergeOption="MergeAllOutputsToASingleAssembly";SingleAssemblyName="ContosoWebPrecompiled"

Build is getting failed with following error message

"C:\WebGoat.NET-master\WebGoat\WebGoat.NET.csproj" (default target) (1) -> (GenerateAssemblyInfoFromExistingAssembleInfo target) ->
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge .targets(289,5): error : @(_AspNetCompile_AssemblyInfo_Count) have 0 item(s) in the collection. It should only have 1 i tem(s). [C:\WebGoat.NET-master\WebGoat\WebGoat.NET.csproj] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge .targets(296,5): error : Target GenerateAssemblyInfoFromExistingAssembleInfo Failed [C:\WebGoat.NET-master\WebGoat\WebG oat.NET.csproj]

Please help me to resolve this issue.


回答1:


You are missing AssemblyInfo.cs in your Properties folder.

Add this file using Visual Studio - Solution Explorer - Properties right-click - Add New Item - Assembly Info File.



来源:https://stackoverflow.com/questions/44265423/msbuild-failure-when-precompilebeforepublish-is-enabled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!