Could not find a suitable SDK to target

2020-08-10 07:41发布

I try to create a project for UWP but I get this error:

enter image description here

6条回答
男人必须洒脱
2楼-- · 2020-08-10 08:18

Weirdly this error occurred for me when trying to create a new solution using a class library for the initial project. The library had the same name as the project. After deleting the two empty directories it managed to leave behind I changed the project type to a console app and it created the solution and console project just fine. I was then able to add the class library project with no issues.

It's always something!

查看更多
不美不萌又怎样
3楼-- · 2020-08-10 08:24

Part of the problem can be solved by choosing an older sdk. Choose the second newest from here: https://developer.microsoft.com/en-us/windows/downloads/sdk-archive

查看更多
Bombasti
4楼-- · 2020-08-10 08:24

I had to install Windows SDK 10.0.10586. (control panel -> visual studio -> modify -> sdk)

Installing newer versions of the SDK would just give the same error.

查看更多
我想做一个坏孩纸
5楼-- · 2020-08-10 08:28

I install windows development kit and it worked. Thanks

查看更多
家丑人穷心不美
6楼-- · 2020-08-10 08:33

Installing the latest SDK didn't help me either. The installer wouldn't complete, kept getting to 97% and then rolling back.

I had a whole load of MDMERGE errors like:

MDMERGE : error MDM2009: Duplicate type Windows.Networking.NetworkOperators.TetheringOperationalState found processing metadata file C:\Users\blah\AppData\Local\Temp\UnionWinmdWorkingFolder\26178\WinMDs\Windows.Networking.NetworkOperators.NetworkOperatorsTetheringContract.winmd, type already exists in file C:\Users\blah\AppData\Local\Temp\UnionWinmdWorkingFolder\26178\WinMDs\Windows.Foundation.UniversalApiContract.winmd.

To resolve this I deleted References in

C:\Program Files (x86)\Windows Kits\10

..and reinstalled. Seems like older kit installs are interfering with new kit installs.

查看更多
孤傲高冷的网名
7楼-- · 2020-08-10 08:35

I am using Visual Studio 2015, and have had the same error. Answers in this post gave me the idea to create console application.

I created a C++ Console application. While doing that, I was prompted with a dialog that allowed me to switch from console application to DLL. In addition, I chose a blank project. Once I performed those steps, the blank DLL project was created, and I did not get the Could not find a suitable SDK to target error.

查看更多
登录 后发表回答