VS2012加载失败
No exports were found that match the constraint
开始->运行->devenv.exe /resetuserdata->回车,再打开就好了
1.WebGrease
未能加载文件或程序集“WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)
解决方法
通过"uninstall-package -f WebGrease"先卸载,然后通过"install-package WebGrease"再下载最新版本,问题解决。
关于使用NuGet程序包卸载和安装:
● 查看版本:到https://www.nuget.org
● 删除程序包:uninstall-package -f WebGrease
● 安装某个版本的程序包:install-package WebGrease -Version 1.3.0
This issue was resolved by upgrading from WebGrease 1.5.2 to 1.6.0 as well as updating Microsoft.AspNet.Web.Optimization
Install-Package Microsoft.AspNet.Web.Optimization
Update-Package WebGrease
Uninstall-Package Microsoft.AspNet.Web.Optimization
Uninstall-Package WebGrease
Install-Package Microsoft.AspNet.Web.Optimization
Update-Package WebGrease
<dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.Unity" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.5.2.14234"/>
</dependentAssembly>
</assemblyBinding>
2.System.Web.Mvc
CS0234: 命名空间“Purple”中不存在类型或命名空间名称“Model”(是否缺少程序集引用?)
行 51: <pages>
行 52: <namespaces>
行 53: <add namespace="Purple.Model" />
行 54: <add namespace="System.Web.Mvc" />
行 55: <add namespace="System.Web.Mvc.Ajax" />
=> 把Copy local 设成True
3.Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration info
http://social.msdn.microsoft.com/Forums/vstudio/en-US/58271e39-beca-49ac-90f9-e116fa3dd3c0/mxed-mode-dll-unable-to-load-in-net-40?forum=clr
在配置文件里加上如下信息即可:
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
<requiredRuntime version="v4.0.20506"/>
</startup>
</configuration>