The type 'IEnumerable<>' is defined in an assembly that is not referenced

时光总嘲笑我的痴心妄想 提交于 2019-12-01 02:23:38

Make sure you have the following lines in your Web.config file:

<compilation debug="true" targetFramework="4.6.1"> //don't need to change THIS line, just the content of this section
  <assemblies>
    <add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <add assembly="System.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </assemblies>
</compilation>

I know its a bit "too" late for answering, but for who just had this error I solved it just as the second half of the error says which is just adding an assembly reference for net standard in the asemblies section in the web config file and as folowing:

< configuration>
...
< system.web>
< compilation debug="true" targetFramework="4.6.1">
< assemblies>
< add assembly="netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"/>
< /assemblies>
< /compilation>
< /system.web>
...
< /configuration>
^_^

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!