必须添加对程序集的引用。

本文发布于 4 年前,部分内容可能已经失去参考价值。

编译器错误消息: CS0012: The type '***' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

错误CS0012类型“***”在未引用的程序集中定义。必须添加对程序集“netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51”的引用。

解决方法:

打开 Web.config,在 <system.web /> 的 <compilation /> 中添加 <assemblies><add>,如:

<compilation debug="true" targetFramework="4.8">
  <assemblies>
    <add assembly="netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"/>
  </assemblies>
</compilation>

缺少其它 assembly 的参照上面添加。

xoyozo 4 年前
转载请注明出处
云服务器 精选特惠
可能相关的内容