emmeter吧 关注:12贴子:96
  • 2回复贴,共1

VS 编译遇到错误 MSB4175的解释

只看楼主收藏回复

若VS不singin 则可能在一段时间之后遇到错误 MSB4175
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CodeAnalysis\Microsoft.CodeAnalysis.targets(214,5) error MSB4175: The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Build.Tasks.v12.0.dll"
解决方法
1 登录后重新编译
2 如果实在是没有账号,那么找到文件C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CodeAnalysis\Microsoft.CodeAnalysis.targets
然后 214行
<Target Name="SetCABuildNativeEnvironmentVariables">
<SetEnvironmentVariable Condition="'$(Language)'=='C++' and '$(CAExcludePath)' != ''" EnvValue="$(CAExcludePath)" EnvKey="CAExcludePath" />
</Target>
对于这个Target
注释掉中间的设置

<Target Name="SetCABuildNativeEnvironmentVariables">
<!--SetEnvironmentVariable Condition="'$(Language)'=='C++' and '$(CAExcludePath)' != ''" EnvValue="$(CAExcludePath)" EnvKey="CAExcludePath" />
</Target>


IP属地:辽宁1楼2020-07-22 10:09回复
    厉害啊,赞一个,很感谢


    IP属地:江苏2楼2020-09-21 09:18
    回复
      广告
      立即查看
      正确写法:
      <Target Name="SetCABuildNativeEnvironmentVariables">
      <!--SetEnvironmentVariable Condition="'$(Language)'=='C++' and '$(CAExcludePath)' != ''" EnvValue="$(CAExcludePath)" EnvKey="CAExcludePath" /-->
      </Target>


      IP属地:浙江3楼2022-09-05 14:49
      回复