it might be adumb question but, i’ve created a project with visual studio using asp.net framework, but i don’t have visual studio in my work machine, so i’m using visual studio code. How can i run that project? or even, create a new one using the structure of asp.net framework without the visual studio templates? i used to build and run using visual studio.
i’ve downloaded dotnet the core sdk and dotnet framework dev pack.
i tried running a new build with console commands like "dotnet build", but since it’s from dotnet core sdk i was already expecting it to fail with an error that says "error MSB4019: the imported project "C:Program Filesdotnetsdk7.0.306MicrosoftVisualStudiov17.0We
bApplicationsMicrosoft.WebApplication.targets" could not be located. confirm the expression in the import declaration "C:Program Filesdotnetsdk7.0.306MicrosoftVisualStudiov17.0WebApplicationsMicrosoft.WebApplication.targ
ets" is correct."
maybe this error is showing because i’m using vscode to run something from visual studio? if so, i still don’t know how to create a project with the dotnet framework structure without using visual studio tempaltes, or run it.
2
Answers
Only .NET core is supported in VS Code.
And for that..
To create a new .NET Core project in vs code, you need to have .net installed on your system. Once it is installed, you can open vs code and verify it using dotnet –version command in terminal.
Once it is done, You need to create a project folder in your system. you can create a new project in vs code using dotnet new console. It will create a console application. And to run it, you can use dotnet run command.
Note: You need to run all these command in the same project folder.
Visual Studio Code support building and debugging projects for the .NET Framework. (Although it is quite limited).
You can debug 64-bit applications with portable PDBs.
Here are the steps which may help you.
Install MSBuild 15 (2017). This is available as part of visual studio build tools for 2017.
This article has more details about it. https://github.com/dotnet/vscode-csharp/wiki/Desktop-.NET-Framework
You may find this stack over flow post as helpful: How to get MSBuild 15 without a full install of Visual Studio?