解决办法:
1、找到UAP.props文件,路径在:
“SDK根目录\DesignTime\CommonConfiguration\Neutral\UAP\10.0.19041.0\”
像我的SDK根目录在D:\Windows Kits\10,全路径就是
“D:\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\10.0.19041.0”
其他版本的SDK应该也是一样,将版本号替换就好。
1、打开UAP.props文件,找到第5行:
<Project xmlns=”http://schemas.microsoft.com/developer/msbuild/2003″>
<PropertyGroup>
<!– Force WindowsSdkDir to always be a parent to this props file –>
<WindowsSdkDir>$([MSBUILD]::GetDirectoryNameOfFileAbove(‘$(MSBUILDTHISFILEDIRECTORY)’, ‘sdkmanifest.xml’))\</WindowsSdkDir>
将第五行修改为:
<WindowsSdkDir Condition="'$(WindowsSdkDir)' == ''">$([MSBUILD]::GetDirectoryNameOfFileAbove('$(MSBUILDTHISFILEDIRECTORY)', 'sdkmanifest.xml'))\</WindowsSdkDir>