2

I use VS code (not VS cause i have linux) and have been trying to run my c# template from run and debug in VS code but it does not works and returns this error in output.

------------------------------------------------------------------------------

You may only use the Microsoft Visual Studio .NET/C/C++ Debugger (vsdbg) with

Visual Studio Code, Visual Studio or Visual Studio for Mac software to help you

develop and test your applications.

------------------------------------------------------------------------------

You must install .NET to run this application.

App: /home/lazare/Documents/lazare/webapi/WebApplication1/bin/Debug/net9.0/WebApplication1

Architecture: x64

App host version: 9.0.10

.NET location: Not found

Learn more:

https://aka.ms/dotnet/app-launch-failed

Download the .NET runtime:

https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=ubuntu.24.04-x64&os=linuxmint.22.2&apphost_version=9.0.10

Failed to resolve libhostfxr.so [not found]. Error code: 0x80008083

The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core.

The program '[73320] WebApplication1' has exited with code 131 (0x83).

but i have dotnet installed. net9. and even when i run it from terminal it works.

lazare@lazare-dell:~/Documents/lazare/webapi$ dotnet run --project /home/lazare/Documents/lazare/webapi/WebApplication1
Using launch settings from /home/lazare/Documents/lazare/webapi/WebApplication1/Properties/launchSettings.json...
Building...
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5025
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /home/lazare/Documents/lazare/webapi/WebApplication1

can you please help me what is going on.

12
  • 2
    Are you running that in the integrated vs code terminal? With the official dotnet extensions (C# Dev Kit) inside OFFICIAL visual studio code builds, it works. If you are using Cursor, for example, you would need to use another debugger than the official one. Commented Nov 11 at 8:53
  • 1
    The error talks about the debugger, not .NET. The last snippet shows running a project, not a template. What are you actually trying to do? How was VS Code and the debugger installed and how are they run? Are you using C# Dev Kit? OmniSharp? Have you followed the Debugging guide and the .NET Debugging in Visual Studio Code page? Commented Nov 11 at 8:53
  • i try to run with. c# [default configurations] and returns the error. i do it like this: so i create project. then i try to run it from run and debug. and it throws error shown above. however when i run from terminal (either from vscode builtin or normal) i works. also i use c# dev kit Commented Nov 11 at 9:02
  • Have you read this: Troubleshoot .NET errors related to missing files on Linux Commented Nov 11 at 9:22
  • 1
    ive tried that but it still returns the error. and this info comes as popup in vs code: "The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core." Commented Nov 11 at 9:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.