无效的调试选项生成错误针对Mac的Visual Studio [英] Invalid Debug Option Build Error Visual Studio for MAC

查看:179
本文介绍了无效的调试选项生成错误针对Mac的Visual Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在构建.NET Core MVC App时出现以下错误.

I am getting following error while building .NET Core MVC App.

Projects/MVCCoreTest/MVCCoreTest/CSC:错误CS1902:无效的调试选项portable'. Valid options are full'或`pdbonly'(CS1902)(MVCCoreTest)

Projects/MVCCoreTest/MVCCoreTest/CSC: Error CS1902: Invalid debug option portable'. Valid options arefull' or `pdbonly' (CS1902) (MVCCoreTest)

这是什么意思,我该在哪里设置这些有效选项?

What does this mean and where do i set those valid options ?

推荐答案

我应该澄清一下,如果您使用VS for Mac创建项目,则不会出现此问题,但是如果您克隆它并且是在Windows中创建的,那么可能您会遇到这个问题.

I should clarify that if you create the project with VS for Mac you shouldn't have this issue, but if you clone it for example and was created in Windows then probably you will get this problem.

我通过删除与Roslyn编译器相关的Nuget软件包解决了该错误:

I resolved the error by removing the Nuget packages related with Roslyn compiler:

  <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.0" targetFramework="net452" />
  <package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net452" developmentDependency="true" />

因此将进行Mono编译.这就是csc编译器盛行于mcs的原因

so the Mono compiler will take place. This is the reason why csc compiler prevale over the mcs

也不要忘记从csproj中删除这些行:

Also don't forget to remove the lines from the csproj:

<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />

希望这会有所帮助,

致谢.

这篇关于无效的调试选项生成错误针对Mac的Visual Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆