Full Visual Studio For Mac
Visual Studio Code is the first code editor, and first cross-platform development tool - supporting OSX, Linux, and Windows - in the Visual Studio family. At its heart, Visual Studio Code features a powerful, fast code editor great for day-to-day use.
I just recently swapped my MS PC for an Mac, I'm trying to continue working on an MVC project, but I'm getting an error (Error CS1902: Invalid option 'portable' for /debug; must be full or pdbonly (CS1902)).
Are there any good documents that explain how to make it work? I have seen people porting MVC to .NET Core, but I can't get the analyser to work on my Mac (not sure it's supported yet).
Mac Version Of Visual Studio
3 Answers
I had this same problem when trying to use Visual Studio for Mac to build a solution that works fine in Windows. Turns out the /debug:portable
flag was being passed to the build command, even though the 'Debug Information' was correctly set to 'Full' in my project settings. Search the build output for 'portable' and you will indeed find the flag there regardless of your settings.
The fix is to upgrade the Microsoft.Net.Compilers nuget package. In my case, it upgraded from 1.0 to 2.7, and then the project built successfully.
I did two things.
Visual Studio On A Mac
I update the Microsoft.Net.Compliers via nuget.https://www.nuget.org/packages/Microsoft.Net.Compilers/
Change one value in the properties of project.https://johnharold.wordpress.com/2017/08/16/csc-error-cs1902-invalid-option-portable-for-debug-must-be-full-or-pdbonly-cs1902/
I wish you can solve the problem
Right click on the project in the solution explorer and go to Options, Build, Compiler and change Debug information to Full