Search code examples
.netlinuxmonomonodevelop

MonoDevelop invalid static method invocation syntax: "[MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)'


I have a Visual Studio 2019 .snl project that I need now to run it on an Ubuntu machine. After reading online I opted for MonoDevelop (since Linux doesn't have Visual Studio version). When I try to run my solution I get the error: invalid static method invocation syntax: "[MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)'

I also created a new solution to test it and I get the same error. I read a lot about this error but most of the issues are very old or about Visual Studio for Mac. Anyway most of the time people said that new releases had the fix needed for this error.

I'm new to Linux and I'm not .Net developer, I just need to run a project that I need in order to program other part of the application, therefor something that might be obvious for you, is not for me :)

I'm also ok in using another Application instead of MonoDevelop, I just want to be able to run that solution and yeah, also apply some minor code changes to it.

Any help is highly appreciate!

Some info:

.Net 5.0

SDK Version: 5.0.101

Ubuntu 20.04

Project is a web app made with .Net Core 3.0


Solution

  • I manage to run my solution with Visual Studio Code as suggested by @Lex Li. i found an article that suggest to install C# and of course .Net Core framework and SDK and then I was able to run the solution with the Debug functionality of VS Code.

    https://laroccanicola.medium.com/first-contact-with-net-core-2-and-visual-studio-code-in-linux-ubuntu-6f0d66c67739

    Not sure why I never found this information in my research for a substitute of VS for Linux, maybe most of the information out there are so outdated that is just recently possible to use VS code for .Net core project. Not sure. I hope this can save time to others