[Solved]-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.


To resolve the "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." error, you can follow these steps:

  1. Ensure that the target process you are trying to run is indeed built for and configured to run on .NET Core.
  2. Check the project configuration and make sure that it targets .NET Core framework.
  3. If you are using a .NET Core application, ensure that the correct SDK and runtime versions are installed on the machine where the target process is being executed.
  4. Verify that the environment variables and settings for the target process are correctly configured to use .NET Core.
  5. If you are running the application in a containerized environment, ensure that the Dockerfile or container configuration specifies the use of .NET Core.
  6. Check for any missing or corrupt dependencies that the target process relies on.
  7. Review the application's logs and any error messages for more specific information about why the process failed to start.
  8. If the target process did not run on .NET Core intentionally, you may need to adjust your expectations or consider migrating the application to .NET Core if feasible.
"The target process exited without raising a CoreCLR started event - Error in output when attempting to run selenium based tests in Visual Studio"

"This error occurs when an expected dependency is missing or is of the wrong version/compatibility level when referenced in the solution.

It happens anytime Visual Studio is trying to execute something but the call of that execution fails.

In my experience, when .NET Core does not have all related components installed like the hosting bundle and the shared .NET Framework libraries for a given SDK version, or any of the other dependency components, then this error will occur.

I've seen .NET Core 3.1 components installed alongside .NET Core 5+ and this error occurs based on that alone.

If anything is wrong with the launchSettings.json for any of the build profiles, then Visual Studio's attempts at starting the application or running any of the commands in the profiles after the build will lead to this error as well.

Recently, I realized that the Microsoft Browser Link library wasn't installed and it also caused this error as the launch browser option in the project was selected.

Noted:

This error will also occur sometimes if browser processes are running for a select browser chosen in the debugging drop-down which conflicts with VS 2019's ability to initiate a browser process for some reason.

"I just encountered the same issue and resolved it, but I'm not sure if it's the same root cause as yours.

In my case, I removed each package and eventually found that the issue is from one package. The package indirectly references Microsoft.NETCore.App (you can find that by checking .deps.json), which references Microsoft.NETCore.Runtime.CoreCLR, and I guess that's not compatible with .NET 5+.

I resolved this issue by updating the package that references Microsoft.NETCore.App to the latest version, which fortunately exists and no longer references it. There are several package version conflicts after it that need to be manually resolved though."

"I was trying to run a project that used .NET Core 2.2, but I didn't have it installed. There was no error (I had 1.1), so after installing 2.2 using the 'Visual Studio Installer', it worked like a charm. =)"

"For me, the issue was that my project was targeting .NET Core 2.2, which I didn't have installed. I'm using Visual Studio 2019.

So, for the solution, just follow these steps:

  1. Open the Visual Studio Installer.
  2. For your Visual Studio 2019 installation, click "Modify".
  3. Click on "Individual Components".
  4. Make sure you check ".NET Core 2.2 Runtime (EOL)" (and above, like .NET Core 3.0, if you want).
  5. Click "Modify" to apply the changes.