feel

VS2017 nlog源码查看报错

最近下载nlog的源码学习,打开解决方案以后无法编译。

 

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference.targets

<NETSdkError Condition="'$(_TargetFrameworkVersionWithoutV)' >= '$(NETStandardMaximumVersionExclusive)'"
ResourceName="UnsupportedTargetFrameworkVersion"
FormatArguments=".NET Standard;$(_TargetFrameworkVersionWithoutV);$(NETStandardMaximumVersionHumanReadable)"
/>

126行报错。

 

 

the current .NET SDK does not support targeting .NET Standard 2.0. Either target .NET Standard 1.6 or lower, or use a version of the .NET SDK that supports .NET Standard 2.0

通过这句英文一直以为是 .net framework 2.0未安装。

安装以后引用不报错(没有黄色感叹号),编译的时候却还是报错。

 

最终谷歌找到了。

原文地址

https://stackoverflow.com/questions/45732236/the-current-net-sdk-does-not-support-targeting-net-standard-2-0-error-in-visua

安装 .net core 2.0可以解决。

https://www.microsoft.com/net/download/core

 

 

百度很久没答案,所以用中文记录一下,避免大家后续继续踩微软的坑。

posted on 2017-10-20 15:08  园友287206  阅读(2432)  评论(0编辑  收藏  举报