0

我目前已经安装了 Visual Studio 2008,版本 9.0.30729.4462,我遇到了一些我认为都相关的相当奇怪的问题。

1.在构建我的解决方案时,我在调试输出中得到了 5-10 个这样的输出:

Project file contains ToolsVersion="4.0", which is not supported by this version of MSBuild. Treating the project as if it had ToolsVersion="3.5".

项目的所有 .csproj 文件都包含toolsversion="3.5".

2.尝试访问项目属性中的安全选项卡时,出现以下错误:

Visual Studio was unable to determine the Code Access Security (CAS) permissions that are applicable to your project. The most likely cause is that your project references a strongly-named assembly that defines custom permissions, but that is not properly installed in the global assembly cache (GAC). To correct this, try the following:

1. Ensure that any custom permissions defining assemblies referenced by your project have been properly installed to the GAC. If any of these assemblies have been rebuilt or have had their version numbers modified, you must install the new assemblies in the GAC.

2. Restart Visual Studio.

在这里寻找解决方案表明这是一个典型的工具版本 4.0 问题;但是,就像我说的,我所有的项目都在 csproj 文件中设置了 3.5。

我应该从哪里开始故障排除?

4

1 回答 1

0

这两个问题都与 toolsversion="4.0" 问题有关。我的解决方案中集成了很多项目,因此我在解决方案目录中搜索了“toolsversion=”。事实证明,我的一些 .csproj 项目文件确实设置为 4.0。一旦所有项目都设置为 3.5,安全选项卡又回来了,编译时我没有收到任何错误。

于 2013-03-20T00:13:13.820 回答