在 Visual Studio 2010 中打开 .NET 2.0 项目时可能会遇到哪些问题?

发布于 2024-08-30 17:09:04 字数 488 浏览 9 评论 0原文

我工作的小型软件团队最近获准升级到 Visual Studio 2010(我们目前使用的是 VS 2005)。我们有几个 ASP.NET 2.0 和 WinForms(在 .NET 2.0 中)项目正在生产中。

我的任务是下载 VS 2010 并查看它与我们当前项目的配合情况。在 VS 2010 中定位较旧的应用程序时,我应该注意哪些问题?如果我在 VS 2010 中打开一个 VS 2005 项目,当我的队友回去在 VS 2005 中打开该项目时,它仍然会很好地放置吗?我们是否必须升级项目才能在 VS 2010 中工作(假设项目本身没有升级到 .NET 4)?我可以使用 VS 2010 编辑旧版 VB6 应用程序(开个玩笑)吗?

我很高兴能够使用最新的软件,但我们担心在已经运行良好的生产应用程序上遇到开发障碍。

注意:我开始悬赏,希望能得到这个问题的更详细的答案。也许答案确实像已经提供的那样简单,但我对有关我们从使用 VS 2005 过渡到 VS 2010 的选项的更多反馈感兴趣。

The small software team I work on recently got approved to upgrade to Visual Studio 2010 (we're currently using VS 2005). We have several ASP.NET 2.0 and WinForms (in .NET 2.0) projects in production.

I've been tasked with downloading VS 2010 and seeing how well it plays with our current projects. What issues should I be aware of when targeting older applications in VS 2010? If I open a VS 2005 project in VS 2010, will it still place nicely when my teammate goes back to open the project in VS 2005? Will we have to upgrade projects to work in VS 2010 (assuming the projects themselves aren't upgraded to .NET 4)? Can I use VS 2010 to edit legacy VB6 apps (just kidding)?

I'm excited to work with the newest software, but we're concerned about running into development snags on production applications that are already working just fine.

NOTE: I started a bounty in hopes of getting a more detailed answer to this question. Perhaps the answer really is as simple as those already provided, but I'm interested in more feedback regarding our options to transition from using VS 2005 to VS 2010.

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

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

发布评论

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

评论(8

知你几分 2024-09-06 17:09:04

您当然必须“升级”您的项目和解决方案文件。这使得在 VS2k5 和 VS2k10 上很难组建混合团队。升级后,解决方案文件和项目文件将无法再在以前版本的 Visual Studio 中打开。

您可以通过为每个解决方案和项目文件准备两份副本来解决此问题,但这很笨拙,因为显然对一个文件所做的更改需要手动复制到另一个文件。

此外,您似乎无法在 VS2010 中使用任何 .NET 4.0 之前的 nit 测试项目。如果您使用 MSTest 来测试 4.0 之前的应用程序,那就完全反对迁移到 VS2k10。您需要将您的应用程序移植到 4.0,或者将您的测试移植到 NUnit。

Beta 1 中存在一些关于解决方案资源管理器布局的错误。 Connect 上列出的所有问题均已“修复”,但值得注意的是,升级向导可能会出现错误,您必须手动修复。假设您的整个团队正在迁移到 vs2k10,这种问题并不是什么大问题,因为如果出现问题,很明显,很容易修复,并且只发生一次。

You will certainly have to "upgrade" your project and solution files. This makes it difficult to have a mixed team on VS2k5 and VS2k10. The solution file and project files can no longer be opened in previous versions of visual studio after they've been upgraded.

You can get around this by having two copies of each of your solution and project files, but this is clumsy as obviously changes made to one will need to be copied manually to the other.

In addition, it seems that you won't be able to use any pre-.NET 4.0 nit test projects with VS2010. If you use MSTest to test pre-4.0 applications, that's an argument against moving to VS2k10 at all. You'd need to port your app to 4.0, or port your tests to e.g. NUnit.

There were some bugs in Beta 1 regarding the layout of the solution explorer. All of the ones listed on Connect are "fixed", but it's worth being aware that the upgrade wizard might make mistakes that you'll have to fix manually. Assuming your whole team is migrating to vs2k10 that kind of issue isn't a big deal as it's pretty obvious if something goes wrong, pretty easy to fix, and only happens once.

书间行客 2024-09-06 17:09:04

我们公司将 ASP.NET 项目从 2005 年迁移到 2008 年从未遇到过任何问题,因此我预计不会出现任何特定问题(尽管我们还没有迁移到 2010 年,所以请记住这一点)。我认识的大多数人都有 有同样的经历。正如其他人提到的,有一个自动升级向导来照顾为您提供的升级,对于我升级的所有项目来说,它总是完美地工作。但是,您将无法在以前版本的 Visual Studio 中打开新升级的解决方案文件(因此,如果您想保留它们,请先备份它们 - 尽管可能破解 .sln 文件以返回(如果确实有必要)。

但是,您可以同时安装多个版本的 Visual Studio(但请记住,只有一个版本可以具有与其关联的默认文件扩展名,并且这可能是您安装的最新版本)。顺便说一句,如果您想知道为什么在没有转换的情况下无法在新版本中打开旧的解决方案,那么 阅读此官方 VS 博客条目。

但请记住,Visual Studio 2010 允许您定位任何早期版本的 .NET Framework。因此,如果由于某种原因您希望您的项目保留在 .NET 2.0 上,您可以这样做。然而,实际上我看不出这有什么真正的优势。就我个人而言,我认为你只需要硬着头皮升级所有东西 - 人们对相同的解决方案使用不同的版本并不实际。

Our company never had any problems moving our ASP.NET projects from 2005 to 2008 and so I wouldn't foresee any particular problems (though we haven't moved to 2010 yet, so bare this in mind). Most people I know have had the same experience. As others have mentioned, there is an automatic upgrade wizard that take care of upgrades for you, and it's always worked flawlessly for all projects I've upgraded . However, you won't be able to open the newly upgraded solution file in previous versions of Visual Studio (so back these up first if you want to retain them - though it may be possible to hack the .sln files to go back if really necessary).

You can, however, have multiple versions of Visual Studio installed at once (but remember that only one version can have default file extensions associated with it and this will likely be latest version you install). Incidentally, if you are interested in why you can't open older solutions in new version without conversion, then read this official VS Blog entry.

Remember, though, that Visual Studio 2010 allows you to target any previous version of the .NET Framework. So, if for some reason you wish your projects to stay at .NET 2.0 you can do so. However, in reality there is no real advantage I can see in this. Personally I think you just need to bite the bullet and upgrade everything - it's not really practical for people to use different versions for the same solutions.

め可乐爱微笑 2024-09-06 17:09:04

您将必须升级该项目。

这将更改解决方案文件,因此该解决方案只能在升级后在 VS2010 上打开。

除此之外,我预计不会有任何问题。

You will have to upgrade the project.

That will change the solution file so this solution can only be opened on VS2010 after upgrading.

Other than that I wouldn't expect any problems.

黑凤梨 2024-09-06 17:09:04

除了提到的内容之外,请查看.NET Framework 4 迁移问题

Besides what was mentioned, take a look at .NET Framework 4 Migration Issues.

想你只要分分秒秒 2024-09-06 17:09:04

当您将项目从 VS 2005 转换为 2008,或从 VS 2008 转换为 2010 时,解决方案文件和项目文件都会被修改。但是,虽然解决方案文件无法再使用早期版本打开,但项目文件可以。

因此,最好的升级方法是:

  1. 在文件系统中导航到原始解决方案 (Original.sln)。
  2. 复制该解决方案文件。
  3. 重命名该副本,以便您知道它是 VS 2008(例如 OriginalVs2008.sln)。
  4. 现在在 VS 2010 中执行升级过程。

升级完成后,您将能够在 VS 2010(使用 Original.sln)或 VS 2008(使用 OriginalVs2008.sln)中打开解决方案。

请记住,您需要保持解决方案同步;如果您将一个项目添加到一个项目,则需要将其添加到另一个项目。但我已经使用这种技术在 VS 2005 和 VS 2008 之间共享项目,并且效果很好。我已经确认在 VS 2008 中创建的项目,然后转换为 VS 2010,仍然可以在 VS 2008 中使用兼容的解决方案文件工作。

When you convert a project from VS 2005 to 2008, or from VS 2008 to 2010, both the solution file and the project files are modified. But while the solution file can't then be opened with the earlier version anymore, the project files can.

Therefore, the best way to upgrade is:

  1. Navigate in the file system to your original solution (Original.sln).
  2. Make a copy of that solution file.
  3. Rename the copy so you know it's VS 2008 (e.g. OriginalVs2008.sln).
  4. Now do the upgrade process in VS 2010.

When the upgrade is finished, you'll be able to open your solution in VS 2010 (using Original.sln) or in VS 2008 (using OriginalVs2008.sln).

Just remember that you need to keep the solutions in sync; if you add a project to one, you'll need to add it to the other. But I've used this technique to share projects between VS 2005 and VS 2008, and it works fine. I've confirmed that a project created in VS 2008, then converted to VS 2010, still works in VS 2008 with a compatible solution file.

陈年往事 2024-09-06 17:09:04

我们正在将 2005 年的解决方案迁移到 2010 年,我们打开解决方案并完成升级向导后,然后将 .Net 版本更改为 4.0,当我们说构建时,它开始抛出 100 个错误:

1。第一个错误:

已导入具有相同标识“mscorlib,Version=2.0.5.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e”的程序集。

解决方案:在记事本中打开您的csproj文件,然后在

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> and
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
 add <NoStdLib>true</NoStdLib> and 
 then find Reference Tag and add <Reference Include="mscorlib" />.

2.第二个错误:

无法删除文件“bin\Debug\<>”。访问路径“<>”被拒绝。

尚未解决...我们已尝试 http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/40ed753e-47af-4638-8a72-1d607102a05c但是问题仍然没有解决,我们必须关闭VS 2010,然后手动删除文件,然后在项目中说构建,如果我们说清理或重建,那么它会给出与上述相同的错误。

3.第三个错误是:

当我们在2010年执行迁移向导时,我们看到所有项目引用(不是dll引用)都消失了,所以我们必须打开所有项目并再次添加项目引用对于所有项目来说这是最乏味的工作。

We are migrating our 2005 solutions to 2010, we opened the solutions and after finishing the upgraded wizard and then changed the .Net version to 4.0, when we say build, it starts throwing 100s of errors:

1. 1st Error:

An assembly with the same identity 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' has already been imported.

Solution: open your csproj file in notepad and find in the

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> and
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
 add <NoStdLib>true</NoStdLib> and 
 then find Reference Tag and add <Reference Include="mscorlib" />.

2. The 2nd error:

Unable to delete file "bin\Debug\<>". Access to the path '<>' is denied.

which is not solved ... we have tried solutions present in the http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/40ed753e-47af-4638-8a72-1d607102a05c but still issue is not solved, we have to close VS 2010 then delete the files manually and then say build in the project, if we say clean or rebuild then it will give the same above error.

3. 3rd Error is:

When we executed the migration wizard in 2010 after that we saw that all the project references (not the dll references) are gone, so we have to open all the projects and again have to add the project reference for all the projects which is the most tedious work.

雨夜星沙 2024-09-06 17:09:04

它将修改项目文件,因此如果不编辑该文件(或确保每个 VS 版本都有副本),则无法在旧版本的 Visual Studio 中打开该文件。

It will modify the project file and therefore in can't be opened anymore in older versions of Visual Studio without editing that file (or make sure you've copies for each VS version).

秋心╮凉 2024-09-06 17:09:04

几天前我将解决方案从 2005 年移至 2010 年。完全没有问题,尽管它是一个包含大量小型、简单的测试项目的解决方案。但完成转换后,您将无法在 2005 年打开该解决方案。

I moved a solution from 2005 to 2010 a couple of days ago. No issues at all, although it was a solution with a large number of small, simple, test projects. You wont be able to open the solution in 2005 though once you've done the conversion.

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