VS2010、2008、2005是否可以打开并编辑同一个项目?

发布于 2024-09-30 20:16:45 字数 115 浏览 2 评论 0原文

假设我想编辑一个用 vs2005 编写的开源项目,并且我有 vs2010。有没有办法让 2005 年以后的 VS 用户可以读取、写入和调试同一个项目?

我正在考虑使用的开源项目是 Lucene.NET

Suppose I'd like to edit an Open Source project that's written in vs2005, and I have vs2010. Is there any way that any user of VS newer that 2005 can read, write, and debug the same project?

The open source project I'm considering this with is Lucene.NET

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

阳光下慵懒的猫 2024-10-07 20:16:45

我还没有尝试过在这三个项目上使用项目,但在此之前我确实已经设法让 2005/2008 和 2008/2010 一起工作。

关键是获取解决方案文件 (.sln) 的副本,而不是项目文件。让 Visual Studio 更新项目文件。

现在,根据我的经验,当您使用旧版本的 Visual Studio 打开旧的解决方案文件时,它仍然会设法加载较新的项目文件。它会发出警告,但根据我的经验,它会工作得很好。

因此,您最终会保留两个(或三个)解决方案文件,每个文件都需要在添加新项目时更新,但每个项目只有一个项目文件。我倾向于根据 VS 的版本来命名解决方案文件,例如:

NodaTime VS2008.sln
NodaTime VS2010.sln

请注意,如果您使用较新版本的 Visual Studio 的一些高级功能(例如旧版本中不可用的设计器)那么它很可能会崩溃。但根据我相对简单的项目的经验(就只有代码而言,很少有出色的设计师),它运作良好。显然,这些项目必须以旧版本的 Visual Studio 也支持的 .NET 版本为目标。

I haven't tried using projects on all three, but I've certainly managed to get 2005/2008 and 2008/2010 to work together before now.

The key is to take a copy of the solution file (.sln) but not the project files. Let Visual Studio update the project files.

Now when you open the old solution file with the old version of Visual Studio, it will still manage to load the newer project files in my experience. It will give a warning, but will work just fine - again, in my experience.

So you end up keeping two (or three) solution files, each of which needs to be updated when you add a new project, but only one project file per project. I tend to name the solution files based on the version of VS, for example:

NodaTime VS2008.sln
NodaTime VS2010.sln

Note that if you use some advanced features of the newer version of Visual Studio (e.g. a designer which isn't available in the older version) then it might well break. But in my experience of relatively simple projects (in terms of there just being code, few fancy designers) it works well. Obviously the projects have to target versions of .NET which the old versions of Visual Studio support too.

ㄖ落Θ余辉 2024-10-07 20:16:45

这是行不通的,因为如果你在 2008 或 2010 年打开一个 VS2005 项目,它要做的第一件事就是将该项目转换为 2008 或 2010。你需要为每个版本的 VS 制作一个单独的项目副本你想和它一起使用的。

This won't work, because if you open a VS2005 project in 2008 or 2010, the first thing it will do is convert the project to 2008 or 2010. You'd need to make a separate copy of the project for each version of VS that you want to use with it.

烟火散人牵绊 2024-10-07 20:16:45

由于转换过程,它不会起作用。然而,VS2005、VS2008和VS2010之间.sln和.csproj文件的变化非常小。您可以保留它们的单独副本或手动进行更改。

有关转换过程的更多信息请参见此处

根据解决方案和项目的复杂程度,这可能是值得的。

It won't work because of the conversion process. However, the changes in the .sln and .csproj files between VS2005, VS2008 and VS2010 are very minor. You can either keep a separate copy of them or make the changes manually.

More information on the conversion process here.

Depending on how complex the solution and projects are, it might be worth it.

乖乖公主 2024-10-07 20:16:45

也许尝试一下 Visual Studio Express 2005,我相信它可以与其他完整版本的 Visual Studio 共存,但我不了解 Lucene.NET,所以不确定它是否会与该版本一起打开\编译。

Maybe try Visual Studio Express 2005, I believe that it can co-exist with other full versions of visual studio, but I don't know Lucene.NET so not sure if it will open\compile with that version.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文