Invalid Debug Option Build Error Visual Studio for MAC

孤人 提交于 2019-12-01 17:27:17

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.

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" />

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

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'))" />

Hope this helps,

Regards.

  • Goto Project Options by right clicking on project ....

  • Goto "Compiler"

  • Change "Debug Information" to "Full" or "Portable". It shall solve this problem.

Please let me know if this has helped.

You could update mono to 5.0 it's a bug in mono 4.8.0 with MSBuild.

You can also update the package reference from Microsoft.Net.Compilers.1.0.0 to Microsoft.Net.Compilers.2.10.0, which worked for me.

Updating NuGet packages fix the error for me. From the menu bar choose:

Project > Update NuGet Packages

after it finished, You are all set

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!