简体   繁体   English

Visual Studio 2010错误:打开.NET 4.0项目时“未安装项目目标框架”

[英]Visual Studio 2010 error: “Project Target Framework Not Installed” when opening a .NET 4.0 project

I am experiencing a rather disconcerting issue with one of my development machines that I hope someone can advise me on. 我的一台开发机器遇到了一个相当令人不安的问题,我希望有人可以告诉我。

I have a large Visual Studio 2010 VB solution, targeting the .NET Framework 4.0 which opens and works just find on numerous Visual Studio 2010 installations - except one. 我有一个大型的Visual Studio 2010 VB解决方案,针对.NET Framework 4.0打开,可以在许多Visual Studio 2010安装中找到 - 除了一个。 The 'error' (more a message) when opening the solution says: 打开解决方案时出现“错误”(更多消息):

Project Target Framework Not Installed 未安装项目目标框架

The VB project is targeting '.NETFramework,Version=v4.0", which is not installed on this machine. You must download this framework in order to open and build this project. In order to proceed, you must select an option below. VB项目的目标是“.NETFramework,Version = v4.0”,它没有安装在这台机器上。你必须下载这个框架才能打开并构建这个项目。为了继续,你必须在下面选择一个选项。

Here's a screenshot with the full context: 这是一个完整上下文的截图:

http://img507.imageshack.us/i/errorlc.jpg/ http://img507.imageshack.us/i/errorlc.jpg/

I have tried: 我努力了:

  1. Repairing (didn't fix), uninstalling and reinstalling Visual Studio (didn't fix) 修复(没有修复),卸载并重新安装Visual Studio(没有修复)
  2. Repairing (didn't fix), uninstalling and reinstalling .NET Framework 4.0 (didn't fix) 修复(没有修复),卸载并重新安装.NET Framework 4.0(没有修复)

Retrying step number 1 again after step number 2 (didn't fix). 在步骤2之后再次重试步骤1(未修复)。

What worked temporarily was when I used a .NET Framework removal tool in order to remove all traces of the .NET Framework 4.0 from the machine (including the registry) and then installing the .NET Framework 4.0 again. 暂时使用的是.NET Framework清除工具,以便从计算机(包括注册表)中删除.NET Framework 4.0的所有痕迹,然后再次安装.NET Framework 4.0。 However the error has returned. 但是错误已经恢复。

I'm not sure if this is a problem with some .NET Framework 4.0 file corruption, something within Visual Studio or simply that Visual Studio cannot find the .NET Framework 4.0. 我不确定这是一个.NET Framework 4.0文件损坏的问题,在Visual Studio中是什么,或者只是Visual Studio找不到.NET Framework 4.0。 (I have found several possible 'explanations' but nothing that resolves this issue. (我找到了几个可能的'解释',但没有解决这个问题。

The machine is running Windows 7 (64 bit). 机器正在运行Windows 7(64位)。

Any ideas towards troubleshooting this issue would be warmly received! 任何解决这个问题的想法都会受到热烈欢迎!

I solved this issue for myself by downloading the appropriate Developer targeting pack. 我通过下载相应的开发人员定位包解决了这个问题。 I made the mistake of trying to download the Runtime one, which apparently does not include the Visual Basic plug-in that you need. 我犯了一个错误,试图下载Runtime,这显然不包括你需要的Visual Basic插件。

I am using .NET Framework 4.5.1, and this is the link to the page I downloaded from: 我正在使用.NET Framework 4.5.1,这是我从以下页面下载的页面的链接:

http://msdn.microsoft.com/en-us/library/5a4x27ek%28v=vs.110%29.aspx http://msdn.microsoft.com/en-us/library/5a4x27ek%28v=vs.110%29.aspx

update or reinstall the framework in question. 更新或重新安装有问题的框架。 run visual studio setup. 运行visual studio设置。 click restore to defaults. 单击“还原为默认值”。 will find all installed frameworks and not modify or remove plugins or liscenses. 将找到所有已安装的框架,而不是修改或删除插件或liscenses。 Even kept my settings. 甚至保持我的设置。

I had the same issue. 我遇到过同样的问题。 My pc has the windows in a small SSD drive and user profiles and both Program Files folders on another disk. 我的电脑有一个小型SSD驱动器中的窗口和用户配置文件以及另一个磁盘上的两个Program Files文件夹。 I solved it by noticing that even I had changed the registry entries about Program Files folders location, the FW setup had still put some files on the default locstion. 我解决了它,注意到即使我更改了有关Program Files文件夹位置的注册表项,FW设置仍然将一些文件放在默认的locstion上。 I copyed them to the right location and at last I have FW 4.0 again on the target frameworks 我将它们复制到正确的位置,最后我在目标框架上再次使用FW 4.0

Thank you Aris ! 谢谢阿里斯

I was wondering why my VS 2010 stopped recognizing the .Net4.0 suddenly, until I came across your post above. 我想知道为什么我的VS 2010突然停止识别.Net4.0,直到我看到你上面的帖子。

I was working on a vbs script which was suppose to refer to %PROGRAMFILES% system variable, and was annoyed that no matter which one used (64bit or the (x86)) I was getting to the Program Files (x86) folder. 我正在研究一个vbs脚本,它假设是指%PROGRAMFILES%系统变量,并且不管使用哪个(64位或(x86))我都进入Program Files (x86)文件夹而感到恼火。 So I found that the registry entry ProgramFilesDir and ProgramFilesDir (x86) under 所以我发现注册表项ProgramFilesDirProgramFilesDir (x86)

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion

have the same value ("Program Files (x86)"), so intuitively change the non x86 value properly. 具有相同的值(“Program Files(x86)”),因此可以直观地更改非x86值。 And that is what messed up my VS 2010 instance. 这就是我的VS 2010实例搞砸了。 Rolled that setting back and now VS is fine, left with the vbs issue though ;) 滚动那个设置回来,现在VS很好,虽然留下了vbs问题;)

I hope that helps anybody. 我希望能帮助任何人。

我通过使用原始安装程序修复我的VS2010安装解决了这个问题。

I had the same problem and tried the work around listed here . 我有同样的问题,并尝试了这里列出的工作。

I went to properties and chose the framework 3.5 and the errors went away. 我去了属性并选择了框架3.5,错误消失了。 I do have the problem that although the 4.0 problem is installed on my computer, Visual Studio can't find it, but I am not using any 4.0 specific functionality, so this works for now. 我确实有问题,虽然我的计算机上安装了4.0问题,但Visual Studio找不到它,但我没有使用任何4.0特定的功能,所以这个现在适用。 If I figure out why the 4.0 framework is not detectable, I'll update this post with the fix for it, too. 如果我弄清楚为什么4.0框架是不可检测的,我也会用它的修复更新这篇文章。

Edit: 编辑:

I don't know WHY there was a problem, but after reviewing the help at this forum . 我不知道为什么会出现问题,但在本次论坛上查看帮助后。 I used this utility to fully uninstall VS2010 and .NET Framework 4.0 . 我使用此实用程序来完全卸载VS2010和.NET Framework 4.0

I then fully reinstalled, AND I installed the Visual Studio 2010 Service Pack 1, and everything works! 然后我完全重新安装,我安装了Visual Studio 2010 Service Pack 1,一切正常!

I hope that helps someone. 我希望能有所帮助。

Your VS solution may have a project (or more) in it that reference something in the full .NET 4.0 profile, which you are likely to have on your development machines... except perhaps the one where you are having the problem. 您的VS解决方案可能包含一个项目(或更多),它引用了完整的.NET 4.0配置文件中的某些内容,您可能会在开发计算机上使用该项目...除非您遇到问题。 The .NET 4.0 Client Profile is definitely different, and doesn't support everything you might be needing . .NET 4.0 Client Profile绝对不同,并不支持您可能需要的所有内容

Solutions that involve fully re-installing Visual Studio work because VS installs the full .NET profile, not the client profile. 涉及完全重新安装Visual Studio工作的解决方案,因为VS安装完整的.NET配置文件,而不是客户端配置文件。

I had the same problem and my solution was: 我有同样的问题,我的解决方案是:

The problem was solved immediately (error message went away). 问题立即得到解决(错误消息消失)。

I managed to resolve the issue by replacing the development machine with a new one. 我设法通过用新的替换开发机器来解决问题。 Not quite a resolution to the problem but it saved a lot of time uninstalling/reinstalling/repairing over and over again. 解决问题的方法并不是很好,但它一次又一次地卸载/重新安装/修复节省了大量时间。

Elsewhere I've seen: In VS 2010, the <TargetFrameworkSubset> tag was changed to <TargetFrameworkProfile> , and we no longer support "Full"; 在其他地方我见过:在VS 2010中, <TargetFrameworkSubset>标签被更改为<TargetFrameworkProfile> ,我们不再支持“Full”; that's why you're getting the error. 这就是你收到错误的原因。 Until we fix this, you can just remove the <TargetFrameworkSubset> tag from your project file, and the project should open properly. 在我们解决此问题之前,您只需从项目文件中删除<TargetFrameworkSubset>标记,项目就可以正常打开。

If you don't have TargetFrameworkProfile specified in your project files then in MPF (at least) it defaults to the latest. 如果您没有在项目文件中指定TargetFrameworkProfile,那么在MPF中(至少)它默认为最新版本。 And may be confused about whether it's installed. 并且可能会对它是否已安装感到困惑。

Similar problem reported on Social MSDN . 社交MSDN上报告了类似的问题。 The unhappy solution was: 不愉快的解决方案是:

I solved the problem myself by doing the following steps: 我通过执行以下步骤自己解决了问题:

a) because my problem occurs the first time after a Windows Security-Update for VS 2008, I´ve done a System-Recovery to get the state before the mentioned Win-Update a)因为我的问题是在VS 2008的Windows安全更新后第一次出现,我在完成上述Win-Update之前完成了系统恢复以获取状态

b) then I´ve un- and re-installed VS 2010 (including .NET Framework 4.0) b)然后我取消并重新安装了VS 2010(包括.NET Framework 4.0)

I'm just posting this because I just ran into this same error. 我只是张贴这个,因为我遇到了同样的错误。

OK for me what worked historically was to manually remove newer versions of .net, then install visual studio. 对我来说,历史上有用的是手动删除更新版本的.net,然后安装visual studio。

In windows 10 by default has a version of .net installed that is built in (I think) so cannot be uninstalled (4.5? 4.7?), at least I think that's what's going on, I certainly cannot remove it via "uninstall" I click that and it just stays in the list (4.5 that is). 在Windows 10默认情况下安装了.net的版本内置(我认为)所以无法卸载(4.5?4.7?),至少我认为这是正在发生的事情,我当然无法通过“卸载”我删除它单击它,它只保留在列表中(4.5即)。 So my old answer, above, no longer works. 所以我上面的旧答案不再适用。

Also another clue, when you install the 7.1 Windows SDK it says "RTM .NET version 4...these components will not be installed". 另外一条线索,当您安装7.1 Windows SDK时,它 “RTM .NET版本4 ......将不会安装这些组件”。

Fix was to uninstall the Windows SDK, then temporarily spoof that version 4.7 was not installed. 修复是卸载Windows SDK,然后暂时欺骗未安装版本4.7。 Then install the SDK. 然后安装SDK。 Now VS 2010 express loads my C++ projects again (I presume what it did was install .net 4.0 successfully). 现在VS 2010 express再次加载我的C ++项目(我认为它的作用是成功安装.net 4.0)。 Either the offline ISO or web version seem to work with this. 离线ISO或Web版本似乎都适用于此。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Visual Studio 2012中为Office 2010构建VSTO项目时,出现“未安装Project Target Framework”错误 - “Project Target Framework Not installed” error comes when building the VSTO project for Office 2010 in Visual studio 2012 Visual Studio 2010中的安装项目需要.NET 4.0 - Setup Project in Visual Studio 2010 Requires .NET 4.0 在Visual Studio 2010中将2.0 Web参考与.net 4.0项目一起使用 - Use 2.0 web reference with .net 4.0 project in visual studio 2010 Visual Studio 2010无法识别.NET Framework 4.0 - Visual Studio 2010 not recognizing .NET Framework 4.0 无法在Visual Studio 2010中打开.Net Framework 4项目 - Unable to open .Net framework 4 project in visual studio 2010 如何在Visual Studio 2010的目标框架中添加点网版本4.0? - How to add dot net version 4.0 in target framework of visual studio 2010? 如何使用 CMake 生成带有 .NET Standard 目标框架的 Visual Studio 项目 - How to generate Visual Studio project with .NET Standard target framework with CMake 如何使 Visual Studio 2010 在 Windows 电话项目上使用 .NET 4.0 而不是 .NET 2.0? - How to make Visual Studio 2010 use .NET 4.0 instead of .NET 2.0 on a Windows Phone project? 安装Visual Studio 2010,我只能选择.NET 4作为我的目标框架 - Installed Visual Studio 2010 and I can only choose .NET 4 as my target framework 未安装项目目标框架 - Project Target Framework Not Installed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM