2017-05-30 74 views
0

我用下面的命令编译使用的MSBuild预编译一个项目启用的MSBuild失败当PrecompileBeforePublish启用

的MSBuild C:\ WebGoat.NET主\ WebGoat \ WebGoat.NET.csproj /p:OutputPath =仓/ p:DeployOnBuild =真 /p:WebPublishMethod = “文件系统”; PrecompileBeforePublish = TRUE; EnableUpdateable = FALSE; DebugSymbols =真 /p:UseMerge = TRUE; WDPMergeOption = “MergeAllOutputsToASingleAssembly”; SingleAssemblyName = “ContosoWebPrecompiled”

生成是越来越失败,以下错误消息

“C:\ WebGoat.NET主\ WebGoat \ WebGoat.NET.csproj”(缺省目标) (1) - >(GenerateAssemblyInfoFromExistingAssembleInfo目标) - >
C:\ Program Files (x86)\ MSBuild \ Microsoft \ VisualStudio \ v14.0 \ Web \ Transform \ Microsoft.Web.Publishing.AspNetCompileMerge .targets(289,5):error:@(_ AspNetCompile_AssemblyInfo_Count)在集合中有0 项目。它应该只有1个电子管(s)。 C:\ Program Files \ (x86)\ MSBuild \ Microsoft \ VisualStudio \ v14.0 \ Web \ Transform \ Microsoft.Web.Publishing.AspNetCompileMerge .targets(296,5):错误:目标 GenerateAssemblyInfoFromExistingAssembleInfo失败 [C:\ WebGoat.NET主\ WebGoat \ WebG oat.NET.csproj]

请帮我解决这个问题。

回答

2

你是在属性文件夹中缺少AssemblyInfo.cs。

使用Visual Studio添加此文件 - 解决方案资源管理器 - 属性右键单击 - 添加新项目 - 装配信息文件。