Running old .Net Projects in VS Code

Here’s the ASP.NET MVC app that I started with: (It’s from 2012 and is configured to use VS 2013)


Now on opening it in VS Code and then “F5” prompts me to create Launch.json and configure task runner, both of which it creates automatically when I say “OK”.

Next I press F5 again to run and it says: The tools version “12.0” is unrecognized. vs code

So then I remove this prop from the .csproj file as quick google tells me this is for MSBuild version hard binding to the project.

Next when I do F5 again, it says: Failed to launch external program msbuild /property:GenerateFullPaths=true.spawn msbuild ENOENT

I’m unable to resolve this error:


Working with C#

The C# support in VS Code is optimized for cross-platform .NET development (DNX) (see working with ASP.NET Core and VS Code for another relevant article). Our focus with VS Code is to be a great editor for cross-platform C# development. For instance, many Unity game developers enjoy using VS Code in place of the MonoDevelop IDE.

We support debugging of C# apps cross-platform via Mono (see Mono Debugging).

Due to this focus many standard C# project types are not recognized by VS Code. An example of a non-supported project type is an ASP.NET MVC Application. In these cases if you simply want to have a lightweight tool to edit a file – VS Code has you covered. If you want the best possible experience for those projects and development on Windows in general, we recommend you use Visual Studio Community.

Common Questions

Q: My Project won’t load.

A: VS Code only supports a limited set of project types (primarily ASP.NET Core). For full .NET project support, we suggest you use Visual Studio Community.

Q: IntelliSense is not working.

A: This is typically as a result of the current project type not being supported. You can see an indication in the OmniSharp flame in the bottom left hand side of the status bar.

Q: How do I build/run my project?

A: VS Code supports tasks for build and natively understand the output of MSBuild, CSC, XBuild. Find out more in the Tasks documentation.



PS: FINALLY, I tried to compile a .net core web api in VS code and command line but neither works: