VS2010转换后的项目引用无效
在 VS2010 中打开 .Net 2 项目,它可以毫无问题地转换项目,但当我尝试构建它时失败。
原因是在 VS2005 中添加了对 System.Web.Extensions 的引用,它是一个 .Net 3.5 程序集。现在 VS2005 从来没有抱怨过这一点并且工作得很愉快,但是 VS2010 更加严格并且不允许这样做。
我尝试将目标框架更改为.Net 3.5,但我遇到了另一种情况,即网页从未显示,它只是挂起,甚至没有到达 Applicatin_OnStart。
如果您能提供有关添加 .Net 2 作为目标框架的参考(时间的首选选项)或让 .Net 3.5 版本正常工作的任何帮助,我们将不胜感激。
[编辑]
好吧,也许参考文献是一条鲱鱼。我的一位同事打开了该项目并进行了转换,一旦他将目标框架更改为 .Net 3.5,一切就都成功了。我们的机器之间的区别在于,他使用的是 32 位 XP,而我使用的是 64 位 Windows 7。当我更改目标版本并尝试运行该程序时,构建似乎在 CppCodeProvider 处停止并挂起。
[编辑]
Opening a .Net 2 project in VS2010 it converts the project without any issues BUT when I attempt to build it fails.
The reason is that in VS2005 a reference was added to System.Web.Extensions which is a .Net 3.5 assembly. Now VS2005 never complained at this and quite happily worked but VS2010 is far more strict and won't allow it.
I've tried changing the targeted framework to .Net 3.5 but I get another situation there where the web page is never displayed, it simply hangs not even getting to Applicatin_OnStart.
Any help either on adding the reference with .Net 2 as target framework (prefered option for time) or getting the .Net 3.5 version to work would be greatly appreciated.
[Edit]
Ok so maybe the reference was a read herring. One of my colleagues opened the project and did the conversion and once he changed the targetted framework to .Net 3.5 it all worked. The difference between our machines is that he's on 32 bit XP and I'm on 64 bit Windows 7. When I change the targetted version and try to run the program the build seems to stop at CppCodeProvider and hang.
[Edit]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查您的 web.config 文件中是否有对 System.Web.Extensions 的引用。可能存在重复的条目或指向旧版本的条目。
Check your web.config file for the references to System.Web.Extensions. It could be there are duplicate entries or entries pointing to older versions.
检查项目是否仅针对客户资料。以下链接可以为您提供其他信息: System.Web.Extensions 程序集无法解析
Check if the project is just targeting the client profile. The following link could provide you additional information: System.Web.Extensions Assembly cannot be resolved