我正在使用以下命令来使用启用预编译的 msbuild 来编译项目
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"
构建失败并出现以下错误消息
"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]
请帮我解决这个问题。
最佳答案
您Properties 文件夹中缺少 AssemblyInfo.cs。
使用 Visual Studio - 解决方案资源管理器 - 属性右键单击 - 添加新项 - 程序集信息文件添加此文件。
关于asp.net - 启用 PrecompileBeforePublish 时 MSBuild 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44265423/