无法加载文件或程序集'System.ComponentModel.Annotations,Version = 4.2.0.0,

时间:2019-08-18 04:53:05

标签: c# .net visual-studio

添加了以下代码

<dependentAssembly>
  <assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.0.0.0" />
</dependentAssembly>

这没有用,也尝试了下面的代码没用

<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

1 个答案:

答案 0 :(得分:0)

您是否尝试过NuGet?

Install-Package System.ComponentModel.Annotations