有人有这个错误的经验吗?
严重性代码描述项目文件行抑制状态 错误项目列表“ ReferencePath”中的项目“ C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Professional \ MSBuild \ Microsoft \ Microsoft.NET.Build.Extensions \ net461 \ lib \ Microsoft.Win32.Primitives.dll” ”未定义元数据“ CopyLocal”的值。为了使用此元数据,可以通过指定%(ReferencePath.CopyLocal)对其进行限定,或者确保此列表中的所有项目都为此元数据定义了一个值。 Batch_WPF
如果我将Visual Studio降级,该问题将消失。
答案 0 :(得分:0)
我通过删除.csproj文件中的以下代码来修复此错误。
<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>
我添加了此代码,以解决“单击一次”的错误,如此处所述:https://github.com/dotnet/standard/issues/529