简体   繁体   English

Visual Studio 2017 加载项目失败

[英]Visual studio 2017 load project failed

Yesterday, I have finished working on my Android project (c# and Xamarin) on Visual Studio 2017, I closed it.昨天,我在 Visual Studio 2017 上完成了我的Android项目(c# 和 Xamarin),我关闭了它。 Today, I re-opened the project in order to continue my work but the project is not loading, plus, I am getting an error in the output window saying:今天,我重新打开了该项目以继续我的工作,但该项目没有加载,另外,我在输出窗口中收到一条错误消息:

There is a missing project subtype.缺少项目子类型。 Subtype: '{EFBA0AD7-5A72-4C68-AF49-83D382785DCF}' is unsupported by this installation.子类型:“{EFBA0AD7-5A72-4C68-AF49-83D382785DCF}”不受此安装支持。

I have searched up and tried every solution online but nothing worked for me.我已经在网上搜索并尝试了所有解决方案,但没有任何效果对我有用。 I tried to delete .suo file , repairing vs.. I do not know what to do.. please help me to solve my problem.我试图删除.suo file ,修复 vs. 我不知道该怎么做.. 请帮我解决我的问题。

Here's a screenshot of the error这是错误的屏幕截图

在此处输入图片说明

UPDATE I enabled Xamarin for Visual Studio, now the error in the output window is (and the project is still failing to load):更新我为 Visual Studio 启用了 Xamarin,现在输出窗口中的错误是(并且项目仍然无法加载):

[I:]:                     Found Xamarin.Android 8.0.0.33
[I:sdk]:                  Runtime path: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android
[I:sdk]:                  Framework path: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0
[I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\VisualStudio\15.0_6c165955\Android\AndroidSdkDirectory found:
    Path contains adb in \platform-tools (C:\Program Files (x86)\Android\android-sdk).
[I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\VisualStudio\15.0_6c165955\Android\AndroidNdkDirectory found:
    Path contains ndk-stack in \. (C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b).
[I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\VisualStudio\15.0_6c165955\Android\JavaSdkDirectory found:
    Path contains jarsigner.exe in \bin (C:\Program Files\Java\jdk1.8.0_131).
[I:]:                     Found Android SDK. API levels: 22, 23, 24, 25

Never worked with XAMARIN before but faced somewhat similar situations with other projects.以前从未与XAMARIN合作过,但在其他项目中遇到过类似的情况。 Here's what you can do :您可以这样做:

1. Create a new project 1.新建一个项目

2. Right click on project > Add > Existing Item 2.右键单击项目>添加>现有项目

3. Browse to the previous projects directory and add all the project files(i mean code files such as .cs) 3.浏览到之前的项目目录并添加所有项目文件(我的意思是代码文件,如.cs)

**4. **4. In winforms, if you add back a form's .cs file, it should automatically load the .designer.cs as well.在 winforms 中,如果您添加回表单的 .cs 文件,它也应该自动加载 .designer.cs。 ** **

After doing so, you can get back the entire project.这样做后,您可以取回整个项目。 There might be a few errors but they are easily fixable.可能有一些错误,但它们很容易修复。 Hope this helps :)希望这可以帮助 :)

I had a global.json with and sdk for dotnet core that wasn't installed.我有一个 global.json 和 sdk 用于未安装的 dotnet 核心。

Either install the targeted version or update your global.json to fit what you have installed.安装目标版本或更新您的 global.json 以适应您已安装的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM