本文介绍了Windows如何知道.sln文件与哪个Visual Studio版本相关?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有VS 2005解决方案,那么它将显示为版本:Visual Studio 2005".如果我有VS 2010解决方案,则sln文件显示为与此相关.

If I have a VS 2005 solution then it shows up as "Version: Visual Studio 2005". If I have a VS 2010 solution, the sln file shows up as related to that.

它们两个都有一个.sln后缀.那么Windows如何知道使用哪个版本的VS?

Both of them have a .sln suffix. So how does Windows know which version of VS to open it with?

推荐答案

它使用属性处理程序和图标处理程序shell扩展(属于Visual Studio版本选择器)
这些通过注册表项HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln(由HKEY_CLASSES_ROOT\.sln引用)注册

It uses Property Handler and Icon Handler shell extensions (part of the Visual Studio Version Selector)
These are registered by the registry key HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln (referenced by HKEY_CLASSES_ROOT\.sln)

打开文件时,它将运行"c:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe" "%1",该文件将从.sln文件中读取版本并打开正确的版本.

When you open the file, it runs "c:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe" "%1", which reads the version from the .sln file and open the correct version.

这篇关于Windows如何知道.sln文件与哪个Visual Studio版本相关?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 01:33