无法加载一个或多个请求的类型。有关更多信息,请检索 LoaderExceptions 属性。

新建一个MVC4的项目,引用DAL后,将DAL的连接字符串考入:

<connectionStrings>
    <add name="brnmallEntities" connectionString="metadata=res://*/BrnMall.csdl|res://*/BrnMall.ssdl|res://*/BrnMall.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=123.7.63.174;initial catalog=brnmall;persist security info=True;user id=sa;password=324324234;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>

本以为没问题,谁知道出现错误: 无法加载一个或多个请求的类型。有关更多信息,请检索 LoaderExceptions 属性。

最后检查发现引用了一个 5.0.0版本的EntityFramework,删掉之后,运行正常

原文地址:https://www.cnblogs.com/scy251147/p/4147538.html