Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening the same .NET Core solution on both Mac and Windows

I've noticed differences between a .NET Core project created in Visual Studio 2015 and a .NET Core project created using dotnet new in Mac.

Considering that VS Code is obviously not the same than VS 2015, is it possible to work on the same .NET Core solution using both a Mac and a Windows machine or are the solutions/projects fundamentally different due to the .sln and .xproj needed in VS 2015?

like image 472
Carlos Torrecillas Avatar asked Mar 12 '23 14:03

Carlos Torrecillas


1 Answers

This should work fine! I've successfully started .NET Core projects on Windows with Visual Studio 2015 and continued them on my Mac with Visual Studio Code 1.3+.

Visual Studio adds extra files like .sln and .xproj, but Visual Studio Code will happily ignore them. The only thing I had to do to get Visual Studio Code to recognize my solution was:

  • Install the C# extension from Microsoft
  • Open the root solution folder in Visual Studio Code
  • Open a code file somewhere in the project and check the lower-right status bar:

status bar

I first had to click a prompt in the status bar to enable C# support. Once I did that, it recognized all the projects in my solution.

like image 88
Nate Barbettini Avatar answered Mar 24 '23 21:03

Nate Barbettini