关于错误could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, Public。。。。
2012-03-28 12:01
405 查看
今天搭建一个WinForm的框架,生成Form层的总是报这个错误:
The referenced assembly "d:\my documents\visual studio 2010\Projects\SLXJHosEme\SLXJHosEme.BLL\bin\Debug\SLXJHosEme.BLL.dll" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project. SLXJHosEme.Forms
最终找到了问题的原因,解释下:
Form层引用了BLL层,生成BLL层时没有报错,可生成Form层的时候却报BLL层有错,原因在于BLL层和Form层应用的.NETFramework版本不用。
奇怪吧,应用哪个版本的.NETFramework我没有主动的改过,但就是不同。
经检查发现,BLL层默认应用的是.NETFramework 4,而Form层默认应用的是 .NETFramework 4 Client Profile。
解决办法,在Form层的属性里,把 .NETFramework 4 Client Profile改为.NETFramework 4错误就没有了。
The referenced assembly "d:\my documents\visual studio 2010\Projects\SLXJHosEme\SLXJHosEme.BLL\bin\Debug\SLXJHosEme.BLL.dll" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project. SLXJHosEme.Forms
最终找到了问题的原因,解释下:
Form层引用了BLL层,生成BLL层时没有报错,可生成Form层的时候却报BLL层有错,原因在于BLL层和Form层应用的.NETFramework版本不用。
奇怪吧,应用哪个版本的.NETFramework我没有主动的改过,但就是不同。
经检查发现,BLL层默认应用的是.NETFramework 4,而Form层默认应用的是 .NETFramework 4 Client Profile。
解决办法,在Form层的属性里,把 .NETFramework 4 Client Profile改为.NETFramework 4错误就没有了。
相关文章推荐
- .NET Web 执行错误Could not load type '...' from assembly '..., Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' because the me
- Could not load file or assembly 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, Public
- 奇葩问题:This file could not be checked in because the original version of the file on the server was moved or deleted. A new version of this file has been saved to the server, but your check-in comments were not saved
- "Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
- Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
- ubuntu(firefox):How to fix "this addon could not be installed because it has not be vireified"
- 配置错误 <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
- 解决---请求“System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”类型的权限已失败。
- Hololens错误提示:can't be loaded because it was not built with the right version or build target.
- 分析器错误消息: 未能加载文件或程序集“System.WEB.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。系统找不到指定的文件。
- System.Web.HttpException: The file "~/xxx//Index.cshtml" cannot be requested directly because it cal
- 解决 未能从程序集“System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”中加载类型 错误
- 未能加载文件或程序集“System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”
- Could not load file or assembly "Microsoft.DataTransformationServices.Design,Version=12.0.0.0,Culture=neutral,PublicKeyToken=89845dcd8080cc91" or one of its dependencies.
- 未能加载文件或程序集“System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个
- System.Web.HttpException: The file "~/xxx//Index.cshtml" cannot be requested directly because it cal
- 【转】未能加载文件或程序集"System.Web.Extensions, Version=1.0.61025.0, Culture=neutral...
- 关于"cannot be resolved or is not a field"错误的解决方法
- System.Web.HttpException: The file "~/xxx//Index.cshtml" cannot be requested directly because it cal
- The requested profile "account" could not be activated because it does not exist 无法maven install的 解决办法,勾选红框选择的选项即可