visual-studio 有没有人设法让 Visual Studio 2003 在 Windows 7 上运行?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/879082/
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
Has anyone managed to get Visual Studio 2003 running on Windows 7?
提问by Jeremy White
Yes, I know... I could set up a virtual machine running XP. Unfortunately our build environment is such that we need to be running VC2003, 2005 and 2008 concurrently and it would be much more convenient if I could run 2003 natively on Windows 7 for the few projects we have that require it.
是的,我知道...我可以设置运行 XP 的虚拟机。不幸的是,我们的构建环境需要同时运行 VC2003、2005 和 2008,如果我可以在 Windows 7 上本地运行 2003 以用于需要它的少数项目,那将会方便得多。
I realize some things may not be available in the IDE, but I was able to run 2003 under windows Vista and if I could get the same base level of functionality under Windows 7 I would be extremely happy.
我意识到有些东西可能在 IDE 中不可用,但我能够在 Windows Vista 下运行 2003,如果我能在 Windows 7 下获得相同的基本功能,我会非常高兴。
Right now I get an error opening the *.pdb file when I compile after switching vc2003 to run as Administrator under compatibility mode for XP SP 2.
现在,当我将 vc2003 切换为在 XP SP 2 兼容模式下以管理员身份运行后编译时,打开 *.pdb 文件时出现错误。
Thanks!
谢谢!
回答by Wayne Hartman
Give XP Mode a try if you can't get it to run natively.
如果您无法让它在本地运行,请尝试 XP Mode。
回答by Nikhil
I wrote a blog entryabout this a while back that you can check out - http://technikhil.wordpress.com/2010/01/12/visual-studio-2003-and-windows-7-can-get-along-really/
不久前我写了一篇关于此的博客条目,您可以查看 - http://technikhil.wordpress.com/2010/01/12/visual-studio-2003-and-windows-7-can-get-along-真的/
The only thing I am stuck on right now is the global search functionality of VS 2003 - it hangs the application. My workaround is to use windows 7 search :-). Other than that - so far so good...
我现在唯一遇到的问题是 VS 2003 的全局搜索功能 - 它会挂起应用程序。我的解决方法是使用 Windows 7 搜索 :-)。除此之外 - 到目前为止一切都很好......
Update: I got the search to work as well by disabling the Aero functionality - I have updated my blog postwith the details...
更新:通过禁用 Aero 功能,我也可以进行搜索 - 我已经用详细信息更新了我的博客文章......
回答by Michael J. Gourlay
(Much of this repeats what's already been written above.)
(其中大部分内容重复了上面已经写过的内容。)
I need to run VS2003 as adminstrator under Win7 64-bit, to support legacy projects (e.g. those that run on the original Xbox). The old XDK requires VS2003, so upgrading is not an option. I could run WinXP but I prefer Win7.
我需要在 64 位 Win7 下以管理员身份运行 VS2003,以支持遗留项目(例如那些在原始 Xbox 上运行的项目)。旧的 XDK 需要 VS2003,所以升级不是一种选择。我可以运行 WinXP,但我更喜欢 Win7。
VS2003 is not officially supported under Win7 and trying to do so creates a couple of fairly annoying problems:
VS2003 在 Win7 下不受官方支持,尝试这样做会产生一些相当烦人的问题:
Find-in-files causes VS2003 to hang. Linking fails due to a PDB file handle leak. The Find-in-files hang is solved by using "Disable visual themes". Navigate to the VS2003 shortcut (Start-->Microsoft Visual Studio .NET 2003), right-click to get context menu, select Compatibility tab, Settings pane, and check "Disable visual themes".
Find-in-files 导致 VS2003 挂起。由于 PDB 文件句柄泄漏,链接失败。Find-in-files 挂起是通过使用“禁用视觉主题”来解决的。导航到 VS2003 快捷方式(开始-->Microsoft Visual Studio .NET 2003),右键单击以获取上下文菜单,选择兼容性选项卡、设置窗格,然后选中“禁用视觉主题”。
The linker failure (LNK1201) happens when you run the program through the debugger, stop it, modify a file and build. The error is that a Visual Studio hold a handle to the PDB file, while the linker tries to write to that file. You can stop and restart VS2003 to bypass the issue. Works but is annoying.
当您通过调试器运行程序、停止它、修改文件并构建时,会发生链接器故障 (LNK1201)。错误是 Visual Studio 持有 PDB 文件的句柄,而链接器尝试写入该文件。您可以停止并重新启动 VS2003 以绕过该问题。有效但很烦人。
You can also use the Microsoft SysInternals "handle.exe" utility to find, then close handles held by a process on a particular file. Write a script to call handle.exe and set up the VS2003 project to run that script as a Pre-Build Event. (See this thread.) But handle.exe requires running as admin.
您还可以使用 Microsoft SysInternals 的“handle.exe”实用程序来查找并关闭特定文件上的进程持有的句柄。编写一个脚本来调用handle.exe 并设置VS2003 项目以将该脚本作为预构建事件运行。(请参阅此线程。)但 handle.exe 需要以管理员身份运行。
You could hypothetically change handle.exe to run as admin using the usual steps (e.g. as a compatibility setting) but then handle.exe (apparently) runs in a nested shell, and then the stdout text does not get to the calling script.
假设您可以使用通常的步骤(例如,作为兼容性设置)将 handle.exe 更改为以管理员身份运行,但随后 handle.exe(显然)在嵌套外壳中运行,然后标准输出文本不会到达调用脚本。
You can make VS2003 run as admin, in which case the Pre-Build script also runs as admin, hence does handle.exe, and that works.
您可以让 VS2003 以管理员身份运行,在这种情况下,预构建脚本也以管理员身份运行,因此可以使用 handle.exe,并且可以正常工作。
The remaining trick is to get VS2003 SLN files to open properly. If you simply make VS2003 run as admin automatically then the VS version selector fails to run VS2003. I don't know why, but it is the case.
剩下的技巧是让 VS2003 SLN 文件正确打开。如果您只是让 VS2003 自动以管理员身份运行,那么 VS 版本选择器将无法运行 VS2003。我不知道为什么,但就是这样。
You could associate SLN files to open using VS2003 devenv.exe instead of VSLauncher.exe. That works but then all new SLN files (2005, 2008, 2010, 2012, ...) fail to open.
您可以使用 VS2003 devenv.exe 而不是 VSLauncher.exe 来关联要打开的 SLN 文件。这有效,但随后所有新的 SLN 文件(2005、2008、2010、2012,...)都无法打开。
So the final step then is to make VSLauncher.exe run as admin. This fails as of KB2492386 as this threadindicates. Uninstalling that update was the final step in this saga, to get everything to work.
所以最后一步是让 VSLauncher.exe 以管理员身份运行。正如该线程所指示的那样,从 KB2492386 开始,这将失败。卸载该更新是这个传奇的最后一步,让一切正常工作。
回答by byteptr
PATCH NOW AVAILABLE
After some reverse-engineering, I found the incorrectly refcounted COM object responsible for the leak (it was off by 1) and developed a stable patch and corresponding article describing the fix. This addresses problems encountered while using Windows 7 thru Windows 10. Details and download available at:
现在可用的补丁
经过一些逆向工程,我发现错误引用的 COM 对象导致了泄漏(它被 1 关闭)并开发了一个稳定的补丁和相应的文章来描述修复。这解决了使用 Windows 7 到 Windows 10 时遇到的问题。详细信息和下载地址:
http://bytepointer.com/articles/vs7.1_2003_on_win7_pdb_handle_leak_bug_unofficial_fix.htm
http://bytepointer.com/articles/vs7.1_2003_on_win7_pdb_handle_leak_bug_unofficial_fix.htm
If you want to perform the patch manually, those details are also included.
如果您想手动执行修补程序,还包括这些详细信息。
NOTE: The SysInternals Handle tool workaround did not work for files on a network-share. The .PDB was not completely unlocked although the Handle tool claimed it was closed. My fix eliminates the problem once and for all and avoids any side effects.
注意:SysInternals Handle 工具解决方法不适用于网络共享上的文件。尽管 Handle 工具声称它已关闭,但 .PDB 并未完全解锁。我的修复一劳永逸地消除了问题,并避免了任何副作用。
回答by Morgan
Run this install. You need to run it from the setup directory, the setup.exe on the root of the cd will not work.
运行此安装。您需要从安装目录运行它,光盘根目录下的 setup.exe 将无法运行。
D:\setup\SetUp.exe /NO_BSLN_CHECK
D:\setup\SetUp.exe /NO_BSLN_CHECK
回答by Codeguard
Solution i found on the web which helped: For your visual studio, use application compatibility = windows vista SP2, and NOT WinXP SP3
我在网上找到的解决方案有帮助:对于您的视觉工作室,使用应用程序兼容性 = windows vista SP2,而不是 WinXP SP3
回答by rahan
I have a really dirty and pathetic workaround for the pdb problem.
对于 pdb 问题,我有一个非常肮脏和可悲的解决方法。
Download and run Sysinternals-ProceXP, press CTRL-F enter the name of pdb(smt like ($ProjectName).pdb) that can't be created while linking. Double click when it is found.(if it can't be found run procexp with administrator priviliges)
下载并运行 Sysinternals-ProceXP,按 CTRL-F 输入链接时无法创建的 pdb(smt like ($ProjectName).pdb) 的名称。找到后双击。(如果找不到,请以管理员权限运行procexp)
Then you will see that the .pdb file is highlighted in the lower pane of the main screen. Right click it and select Close Handle. When you retry building your solution it wont raise an error.
然后您将看到 .pdb 文件在主屏幕的下部窗格中突出显示。右键单击它并选择关闭句柄。当您重试构建解决方案时,它不会引发错误。
I dont know if this solution can be scripted but it is at least better than restarting visual studio.
我不知道这个解决方案是否可以编写脚本,但至少比重新启动 Visual Studio 好。
回答by kaos
I've been using Visual studio 2003 on win7 since the very first RC edition was released :S why do people have issues?
自从第一个 RC 版本发布以来,我一直在 Win7 上使用 Visual Studio 2003 :S 为什么人们有问题?
回答by Christopher
I have attempted to install VS2003 on Windows 7 64-bit using the Virtual Windows XP feature. I'm reasonably certain that this will be successful. The issue I ran into is that the installer wants IIS installed, and the XP installation provided by the Virtual XP doesn't have that enabled by default.
我曾尝试使用 Virtual Windows XP 功能在 Windows 7 64 位上安装 VS2003。我有理由肯定这会成功。我遇到的问题是安装程序需要安装 IIS,而 Virtual XP 提供的 XP 安装默认没有启用。
If you go to Add/Remove components, and try to add it, it will ask for the disc, which I didn't have on hand. Once I get my hands on the disc, I'm pretty sure that it will run fine.
如果您转到“添加/删除组件”并尝试添加它,它会询问我手头没有的光盘。一旦我拿到光盘,我很确定它会运行良好。
If you haven't tried it for other apps, the Virtual XP feature is reallyneat...
如果您还没有尝试过其他应用程序,Virtual XP 功能真的很不错……
回答by QuiOui
I am experiencing the same issue; devenv.exe is leaving pdb files open after running the project. I have made a batch file to work around it, it closes all .pdbfiles open by devenv.exe:
我遇到了同样的问题;devenv.exe 在运行项目后让 pdb 文件保持打开状态。我制作了一个批处理文件来解决它,它会关闭由 devenv.exe 打开的所有 .pdb文件:
handle.exe .pdb | awk "/devenv.exe/ { split($4, fd, \":\"); system(\"handle.exe -c \" fd[1] \" -y -p \" $3)}"
handle.exe .pdb | awk "/devenv.exe/ { split($4, fd, \":\"); system(\"handle.exe -c \" fd[1] \" -y -p \" $3)}"
You will need to have handle.exe by sysinternals and awk by gnu in your path to make it work.
您需要在路径中使用 sysinternals 的 handle.exe 和 gnu 的 awk 才能使其工作。
Use at your own risk. Closing handles can cause application or system instability.
使用风险自负。关闭句柄会导致应用程序或系统不稳定。

