asp.net - 启用 PrecompileBeforePublish 时 MSBuild 失败

标签 asp.net msbuild precompile

我正在使用以下命令来使用启用预编译的 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/

相关文章:

visual-studio-2008 - 您如何在发布版本期间自动部署网站?

wpf - 如何在 appxmanifest 中自动提供版本?

msbuild - 如何将 MSB3245(无法解析引用)警告视为错误?

ruby-on-rails-3 - Heroku 预编译 Assets 没有结果

css - Rails 似乎要求我在 CSS 对 Development 生效之前进行预编译

asp.net - 用 HTML5 替换桌面 WPF 应用程序

c# - 在您的 app.config 中使用加密的 appSettings 元素有多安全?

javascript - 如何将复杂的参数发送到asp.net

asp.net - 当我编辑 web.config 时会发生什么?

ruby-on-rails-4 - 使用 Bundler 和 Rails 4 从生产中删除开发 gem