更新到 Visual Studio 15.8.5 后的构建问题 [英] Build issues after updating to visual studio 15.8.5
问题描述
有人遇到过这个错误吗?
Does anyone have experience with this error?
严重性代码描述项目文件行抑制状态错误项目列表ReferencePath"中的项目C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildMicrosoftMicrosoft.NET.Build.Extensions et461libMicrosoft.Win32.Primitives.dll"" 没有定义元数据CopyLocal"的值.要使用此元数据,请通过指定 %(ReferencePath.CopyLocal) 对其进行限定,或确保此列表中的所有项目都为此元数据定义一个值.Batch_WPF
Severity Code Description Project File Line Suppression State Error The item "C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildMicrosoftMicrosoft.NET.Build.Extensions et461libMicrosoft.Win32.Primitives.dll" in item list "ReferencePath" does not define a value for metadata "CopyLocal". In order to use this metadata, either qualify it by specifying %(ReferencePath.CopyLocal), or ensure that all items in this list define a value for this metadata. Batch_WPF
如果我降级 Visual Studio,问题就会消失.
If I downgrade visual studio the issue goes away.
推荐答案
我已通过删除 .csproj 文件中的以下代码来修复此错误.
I've fixed this error by removing the following code in my .csproj file.
<Target Name="FixClickOnceDependencies" BeforeTargets="_DeploymentComputeClickOnceManifestInfo">
<ItemGroup>
<_noCopyRefs Include="@(ReferencePath)" Condition="'%(ReferencePath.Private)' == 'false'" />
<_noCopyRefsByFileName Include="@(_noCopyRefs->'%(FileName)')">
<OriginalItem>%(Identity)</OriginalItem>
</_noCopyRefsByFileName>
<_libByFileName Include="@(ReferenceCopyLocalPaths->'%(FileName)')">
<OriginalItem>%(Identity)</OriginalItem>
</_libByFileName>
<_overlappingRefByFileName Include="@(_noCopyRefsByFileName)" Condition="'@(_noCopyRefsByFileName)' == '@(_libByFileName)' AND '%(Identity)' != ''" />
<_overlappingLibByFileName Include="@(_libByFileName)" Condition="'@(_noCopyRefsByFileName)' == '@(_libByFileName)' AND '%(Identity)' != ''" />
<_overlappingRef Include="@(_overlappingRefByFileName->'%(OriginalItem)')" />
<_overlappingLib Include="@(_overlappingLibByFileName->'%(OriginalItem)')" />
</ItemGroup>
<ItemGroup Condition="'@(_overlappingRef)' != ''">
<ReferencePath Remove="@(_overlappingRef)" />
<ReferencePath Include="@(_overlappingLib)">
<Private>True</Private>
</ReferencePath>
</ItemGroup>
我添加此代码是为了修复 Click Once 的错误,如下所述:https://github.com/dotnet/standard/issues/529
I added this code in order to fix an error with Click Once, as described here: https://github.com/dotnet/standard/issues/529
这篇关于更新到 Visual Studio 15.8.5 后的构建问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!