C#项目的目标是“.Net Framework,版本=v4.5”,这台机器上没有安装

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17606178/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 10:00:20  来源:igfitidea点击:

The C# project is targeting ".Net Framework, Version =v4.5",which is not installed on this machine

c#.net

提问by Ivy

I am working on a C# project using VS 2012 installed on windows 8 this afternoon. It works well and I upload my code to TFS before I left for home.

今天下午我正在使用安装在 Windows 8 上的 VS 2012 处理 C# 项目。它运行良好,我在回家之前将代码上传到 TFS。

But when I download and open this project using VS 2012 installed on windows 7. I got the error message below.

但是当我使用安装在 Windows 7 上的 VS 2012 下载并打开这个项目时,我收到了下面的错误消息。

The C# project is targeting ".Net Framework, Version =v4.5",which is not installed on this machine. To proceed, select an option below.

  1. Change the target to .Net Framework 4.5. You can change back to ".Net Framework, Version=v4.5" at later time.
  2. Download the targeting pack for ".Net Framework, Version=v4.5". The project will not change.
  3. Do not load the project.

C# 项目的目标是“.Net Framework,版本=v4.5”,这台机器上没有安装。要继续,请选择下面的一个选项。

  1. 将目标更改为 .Net Framework 4.5。您可以稍后改回“.Net Framework, Version=v4.5”。
  2. 下载“.Net Framework, Version=v4.5”的目标包。项目不会改变。
  3. 不要加载项目。

I am sure I have installed .Net Framework 4.5 on my windows 7 laptop. Now, I cannot load my project. Any one knows how to solve this problem?

我确定我已经在我的 Windows 7 笔记本电脑上安装了 .Net Framework 4.5。现在,我无法加载我的项目。有谁知道如何解决这个问题?

Many thanks!

非常感谢!

--------------- updates--------

- - - - - - - - 更新 - - - -

For people who have the same problem:

对于有同样问题的人:

I uninstalled VS 2012 and .Net Framework 4.5 and re install both of them. The problem is solved. Now I can load my project.

我卸载了 VS 2012 和 .Net Framework 4.5 并重新安装了它们。问题已经解决了。现在我可以加载我的项目了。

回答by God Inez

Right-click your project and click in "Properties". In the tab "Application" see if you have the option for the 4.5 framework in the "Target Framework" dropdown list. If you have it, just select it and try to build your project again. If you don't have this option, go to "Programs and Features" in Windows 7 and make sure you have .NET Framework 4.5 installed. If you have it, then try repairing your installation of VS 2012 in this same menu and verify again your options in the "Target Framework" dropdown list.

右键单击您的项目,然后单击“属性”。在“应用程序”选项卡中,查看“目标框架”下拉列表中是否有 4.5 框架的选项。如果您有它,只需选择它并尝试再次构建您的项目。如果您没有此选项,请转到 Windows 7 中的“程序和功能”并确保您已安装 .NET Framework 4.5。如果有,请尝试在同一菜单中修复 VS 2012 的安装,并再次验证“目标框架”下拉列表中的选项。