




















单元测试启动调试或运行时出现error MSB3113: Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version=2.0.50727.0'.
这是什么意思?CLR找不到?
安装的Team Suite调试dll项目都运行的OK啊,这么突然不行了呢?
第一招,关闭,重启VS2005,错误还在,5555
难道是.net坏了?要重装VS2005?不是吧? 才刚装的啊。。。。。
第二招,Google
还好,microsoft似乎早发现了这个问题,看看来自官网的说明(CLR not found):
When you build a solution of a Microsoft Visual Basic 2005 Windows Application project in Microsoft Visual Studio 2005, you may receive an error message that is similar to the following:
error MSB3113: Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version=2.0.50727.0'.
CAUSE
This problem may occur if all the following conditions are true:
•The solution contains an application that has a reference to another application in the same solution.
•You publish the referenced application to a UNC share or to a Web page.
.....
To work around this problem, use a file reference instead of a project reference in the solution of the Visual Basic 2005 Windows Application project.
里面只提到VB2005,但我使用的是C# 2005的,不管是不是,试一下就知道了。 试一下,OK哦。。
以前的工程为什么没出现这个错误?
对于产生问题的第一个条件我的程序是满足的,而且我相信大家的程序也大都满足这个条件,因为你一般都有一个测试项目,而测试项目一般会引用同一个解决方案里的其它项目,而这些项目之间必然有依赖的关系。
Google的时候发现出现报这个问题的人也不多,没多少提出这个错误的,可能这主要是第二个条件没有得到满足,因为对于win form的项目我们一般不会把它们发布到UNC共享路径下,更加不会把它发不到一个web site上去。
但是当Click Once出现之后情况就不一样了。如果你用过Click Once技术来发布应用程序,应该知道在发布的时候需要指定发布的地址,“很巧”,这个路径就是一个UNC共享路径或者是一个Web Site。不巧的是昨天我正好用Click Once的方式发布了我的WordDocumentParser V2.0.5.2,接下来的情形就是你们看到的了。
那简单,把Click Once请走不就可以了吗?上了贼船就不要想溜了:-)Click Once这个被MS吹得一塌糊涂的技术,不知道是不是太强了,抑或是我了解的不够深入,反正我是请不走它。不过好像C#的MVP也是拿它没办法,看看“Have you ever seen MSB3113 and MSB3114 errors?”。
“ClickOnce-ed 之后程序的配置怎么办?”
资料内容来源: http://raderdotnet.spaces.live.com/Blog/cns!3461738A506327E!371.entry
本文保留主要内容,但按照个人研究问题的思路重新编排了。 记录之以便自己查阅。如能给其他遇此问题的同仁以参考且感觉比原文易读,则甚幸。
Collect and Edited By kevin
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。