.net 为什么 Visual Studio 无法打开 .csproj 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/340138/
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
Why is Visual Studio not able to open .csproj files?
提问by Mil
I have the odd problem that I am not able to open the properties of my .NET projects in Visual Studio. If I try to open it by clicking on the Properties tree node in the Solution Explorer I get the following message:
我有一个奇怪的问题,我无法在 Visual Studio 中打开我的 .NET 项目的属性。如果我尝试通过单击解决方案资源管理器中的属性树节点来打开它,我会收到以下消息:
There is no editor available for '....csproj'. Make sure the application for the file type (.csproj) is installed.
没有可用于“....csproj”的编辑器。确保安装了文件类型 (.csproj) 的应用程序。
If I try to open the project properties by the main menu nothing happens at all.
如果我尝试通过主菜单打开项目属性,则根本没有任何反应。
I already tried to reset the Visual Studio settings by command line and a repair installation but nothing helped so far.
我已经尝试通过命令行和修复安装重置 Visual Studio 设置,但到目前为止没有任何帮助。
I use the Visual Studio 2008 in version 9.0.30729.1 SP including the XNA Game Studio 3.0, ReSharper 4.1 and Visual SVN 1.5.1.
我在版本 9.0.30729.1 SP 中使用 Visual Studio 2008,包括 XNA Game Studio 3.0、ReSharper 4.1 和 Visual SVN 1.5.1。
It is occurring on all my projects and seems to be a local issue because my co-workers do not have this kind of problem.
它发生在我所有的项目中,似乎是本地问题,因为我的同事没有这种问题。
Help is much appreciated!
非常感谢帮助!
Thanks, Michael
谢谢,迈克尔
回答by Mil
Repair installation doesn't worked as I mentioned in my question. The problem was solved by using the command line with
正如我在问题中提到的那样,修复安装不起作用。问题是通过使用命令行解决的
devenv /ResetSkipPkgs
BUT after that I had to reset some of my Resharper settings.
但在那之后我不得不重置我的一些 Resharper 设置。
回答by Akhil
I had the same issue. tried running "devenv /ResetSkipPkgs", repairing the installation ... with no luck.
我遇到过同样的问题。尝试运行“devenv /ResetSkipPkgs”,修复安装......但没有运气。
I opened the .csproj file (in a text editor), and looked for all References in the csproj file. Apparantly, i found the line where it references MVC 1.0 (which i havent installed assuming MVC 2.0 would be backward compatible!?)
我打开了 .csproj 文件(在文本编辑器中),并在 csproj 文件中查找了所有引用。显然,我找到了它引用 MVC 1.0 的行(假设 MVC 2.0 向后兼容,我还没有安装它!?)
i installed MVC 1.0, and boom ... it works!
我安装了 MVC 1.0,然后繁荣......它有效!
just check for all references in the .csproj file, and install them as needed.
只需检查 .csproj 文件中的所有引用,并根据需要安装它们。
回答by Cameron MacFarland
Do you have SQL Server installed? If so are you accidentally opening the project with the VS2005 shell that's installed as part of SQL Server?
你有安装 SQL Server 吗?如果是这样,您是否不小心使用作为 SQL Server 一部分安装的 VS2005 shell 打开了项目?
回答by sliderhouserules
Sounds to me like you need to do a full uninstall and reinstall from scratch. You've likely lost some setting or corrupted some registry key. You can either fish around until you find your errant setting, or you can spend the time to just reinstall.
在我看来,您需要完全卸载并从头开始重新安装。您可能丢失了某些设置或损坏了某些注册表项。您可以四处钓鱼,直到找到错误的设置,也可以花时间重新安装。
Don't do a repair install. Remove VS (and the other programs/utilities you mentioned) from your machine and do a clean install.
不要进行修复安装。从您的机器中删除 VS(以及您提到的其他程序/实用程序)并进行全新安装。
回答by Tom Anderson
Open up the .csproj in notepad and check the <ProjectTypeGuids> tag, if it exists then you may not have one of the project types installed.
在记事本中打开 .csproj 并检查 <ProjectTypeGuids> 标记,如果它存在,那么您可能没有安装其中一种项目类型。
回答by Manuel Rozier
If none of the above answers work, you can also launch again the installer, choose “remove or add functionalities”, and add all “additional language tools” available for “Visual C#“ in the functionalities list. For instance in my case I was missing "Visual studio tools for office" that was needed to allow the .csproj to be opened.
如果以上答案都不起作用,您还可以再次启动安装程序,选择“删除或添加功能”,然后在功能列表中添加所有可用于“Visual C#”的“其他语言工具”。例如,在我的情况下,我缺少允许打开 .csproj 所需的“Office Visual Studio 工具”。
回答by Anoop
I had the same issue when i un-installed an extensionfrom the extensions and updates. I tried all the options mentioned above but no luck. It showed me xamarin shell package did not load correctlyevery time i tried to load the app.
当我从扩展和更新中卸载扩展时,我遇到了同样的问题。我尝试了上面提到的所有选项,但没有运气。它显示我每次尝试加载应用程序时xamarin shell 包都没有正确加载。
Then the issue was resolved by Repairing the Xamarin.VisualStudio using the Xamarin.VisualStudio_<version>.msi.. By this .csproj issue will be resolved.
然后通过使用 Xamarin.VisualStudio_ <version>.msi修复 Xamarin.VisualStudio 解决了该问题。. 通过这个 .csproj 问题将得到解决。

