为什么 Visual Studio 无法打开 .csproj 文件?

发布于 2024-07-09 22:55:11 字数 478 浏览 6 评论 0原文

我遇到一个奇怪的问题,即无法在 Visual Studio 中打开 .NET 项目的属性。 如果我尝试通过单击解决方案资源管理器中的“属性”树节点来打开它,我会收到以下消息:

没有可用于“....csproj”的编辑器。 确保安装了该文件类型 (.csproj) 的应用程序。

如果我尝试通过主菜单打开项目属性,则什么也不会发生。

我已经尝试通过命令行和修复安装重置 Visual Studio 设置,但到目前为止没有任何帮助。

我使用 Visual Studio 2008 版本 9.0.30729.1 SP,包括 XNA Game Studio 3.0、ReSharper 4.1 和 Visual SVN 1.5.1。

它发生在我的所有项目上,似乎是一个本地问题,因为我的同事没有此类问题。

非常感谢帮助!

谢谢, 迈克尔

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:

There is no editor available for '....csproj'. Make sure the application for the file type (.csproj) is installed.

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.

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.

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

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

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

发布评论

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

评论(7

安静被遗忘 2024-07-16 22:55:11

正如我在问题中提到的那样,修复安装不起作用。 通过使用命令行解决了这个问题

devenv /ResetSkipPkgs

,但之后我不得不重置一些 Resharper 设置。

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.

忘年祭陌 2024-07-16 22:55:11

我遇到过同样的问题。 尝试运行“devenv /ResetSkipPkgs”,修复安装......但没有运气。

我打开 .csproj 文件(在文本编辑器中),然后查找 csproj 文件中的所有引用
显然,我找到了引用 MVC 1.0 的行(我还没有安装,假设 MVC 2.0 会向后兼容!?)

我安装了 MVC 1.0,然后……它可以工作了!

只需检查 .csproj 文件中的所有引用,然后根据需要安装它们。

I had the same issue. tried running "devenv /ResetSkipPkgs", repairing the installation ... with no luck.

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!?)

i installed MVC 1.0, and boom ... it works!

just check for all references in the .csproj file, and install them as needed.

雄赳赳气昂昂 2024-07-16 22:55:11

您安装了 SQL Server 吗? 如果是这样,您是否不小心使用作为 SQL Server 一部分安装的 VS2005 shell 打开了该项目?

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?

拧巴小姐 2024-07-16 22:55:11

在我看来,您需要完全卸载并从头开始重新安装。 您可能丢失了某些设置或损坏了某些注册表项。 您可以四处寻找,直到找到错误的设置,也可以花时间重新安装。

不要进行修复安装。 从您的计算机中删除 VS(以及您提到的其他程序/实用程序)并进行全新安装。

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.

划一舟意中人 2024-07-16 22:55:11

在记事本中打开 .csproj 并检查标签,如果存在,那么您可能没有安装其中一种项目类型。

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.

羁拥 2024-07-16 22:55:11

如果上述答案都不起作用,您还可以再次启动安装程序,选择“删除或添加功能”,然后在功能列表中添加可用于“Visual C#”的所有“其他语言工具”。
例如,在我的例子中,我缺少允许打开 .csproj 所需的“Office Visual studio 工具”。

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.

肤浅与狂妄 2024-07-16 22:55:11

当我从扩展和更新中卸载扩展时,我遇到了同样的问题。 我尝试了上面提到的所有选项,但没有运气。 每次我尝试加载应用程序时,它都显示 xamarin shell 包未正确加载

然后,通过使用 Xamarin.VisualStudio_.msi 修复 Xamarin.VisualStudio 解决了该问题。。 通过这个 .csproj 问题将得到解决。

I had the same issue when i un-installed an extension from the extensions and updates. I tried all the options mentioned above but no luck. It showed me xamarin shell package did not load correctly every time i tried to load the app.

Then the issue was resolved by Repairing the Xamarin.VisualStudio using the Xamarin.VisualStudio_<version>.msi.. By this .csproj issue will be resolved.

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