1、找到以下文件
C:WindowsMicrosoft.NETFrameworkv3.5Microsoft.CompactFramework.Common.targets
2、用记事本打开该文件,找到以下节点,按照加粗亮底的部分,修改后保存。
<Target Name="PlatformVerificationTask" Condition="'$(SkipPlatformVerification)' == 'true'" >
<PlatformVerificationTask
PlatformFamilyName="$(PlatformFamilyName)"
PlatformID="$(PlatformID)"
SourceAssembly="@(IntermediateAssembly)"
ReferencePath="@(ReferencePath)"
TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
PlatformVersion="$(TargetFrameworkVersion)"/>
</Target>
3、重启VS,再次编译