visual-studio 在 Visual Studio 2010 中打开现有项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3477222/
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
Opening existing project in Visual Studio 2010
提问by user419585
All,
全部,
I have a project that was originally written in vs 2005 or earlier (don't remember bc I didn't write it). I opened it in vs2008 and converted it although it still has the csproj file. sln file states:
我有一个最初是在 vs 2005 或更早版本中编写的项目(不记得我没有写过)。我在vs2008中打开并转换了它,尽管它仍然有csproj文件。sln 文件指出:
Microsoft Visual Studio Solution File, Format Version 10.00
Microsoft Visual Studio 解决方案文件,格式版本 10.00
Visual Studio 2008
视觉工作室 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "foo", "foo.csproj", "{BF9BAC88-C507-404D-928C-BC08193F5CCD}" EndProject
项目("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "foo", "foo.csproj", "{BF9BAC88-C507-404D-928C-BC08193F5CCD}" EndProject
I have worked with the project many times in vs2008 without any problem.
我在 vs2008 中多次使用该项目,没有任何问题。
Now I am running vs2010 on a virtual machine and want to open this project in it. However, when I try I get the "cannot be opened because its project type .csproj is not supported by this version of the application" error. Main solution files are foo.sln, foo.csproj, and foo.csproj.user (in addition to code files). I am somewhat confused as I thought using it in vs2008 (and going through the initial conversion) would make the jump to vs2010 painless.
现在我在虚拟机上运行vs2010,想在里面打开这个项目。但是,当我尝试时,出现“无法打开,因为此版本的应用程序不支持其项目类型 .csproj”错误。主要的解决方案文件是 foo.sln、foo.csproj 和 foo.csproj.user(除了代码文件)。我有点困惑,因为我认为在 vs2008 中使用它(并通过初始转换)可以轻松跳转到 vs2010。
What am I missing? All my searches end up with the same few posts about converting projects in 2008.
我错过了什么?我所有的搜索结果都是关于 2008 年转换项目的几篇相同的帖子。
Thanks!
谢谢!
回答by Splodgi
This is a bug in Visual Studio 2010. I pointed it out to Microsoft when testing VS2010Beta and they first said they couldn't repeat it and then when I told them how easy it is to repeat they said that it isn't important.
这是 Visual Studio 2010 中的一个错误。我在测试 VS2010Beta 时向微软指出了它,他们首先说他们不能重复,然后当我告诉他们重复是多么容易时,他们说这并不重要。
It is easy to get around it. Open VS2010 first, browse to the project, open it. VS2010 then does the usual asking if you want to convert it and say yes and it succeeds.
绕过它很容易。先打开VS2010,浏览到项目,打开。VS2010 然后做通常的询问是否要转换它并说是,它成功了。
Archives downloaded from the internet may have to be "Unblocked" first. VS2010 continued to have this problem with a source tree until I "Unblocked" the originating archive and re-extracted its contents into a recreated directory.
从 Internet 下载的档案可能必须先“解锁”。VS2010 的源代码树继续存在此问题,直到我“解除阻止”原始存档并将其内容重新提取到重新创建的目录中。
回答by Jon Skeet
Open up Visual Studio and check that your installation genuinely contains the C# components. I believe you'd see this error if you had (say) Visual Basic Express installed, but not Visual C# Express.
打开 Visual Studio 并检查您的安装是否真正包含 C# 组件。我相信如果您安装了(比如说)Visual Basic Express,而不是 Visual C# Express,您会看到这个错误。

