简体   繁体   中英

C# code written in Visual Studio won't run in Visual Studio Code

I am trying to run a .NET Core Application in Visual Studio Code that was created in Visual Studio 2019. I'm having trouble with the dotnet run part, though. It keeps giving me this error:

Unable to run your project.
Ensure you have a runnable project type and ensure 'dotnet run' supports this project.
A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'.
The current OutputType is 'Exe'.

I have tried dotnet restore, dotnet build, dotnet clean, etc. Any suggestions on how to get this to run?

Terminal Output

I am not sure if this is your problem, but I experienced something similar recently. Some applications coded in VS will not run in VS Code. VS 2019 utilizes IIS Express to run applcations on localhost. I do not believe VS Code has this ability as a text editor, compared to the power of VS 2019 as a IDE.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM