.NET Core console application crashes on debug

159 Views Asked by At

2-3 days ago I have updated all Nuget packages and checked - everything worked.

Then I upgraded from System.Data.SqlClient to Microsoft.Data.SqlClient and configured what needed for the connection to work - everything worked.

Then I upgraded from .NET Core 7 to .NET 8 and everything worked.

Today, I'm trying to debug the code for a problem, and it crashes with the error:

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 '[42000] console.exe' has exited with code 3221225477 (0xc0000005) 'Access violation'.

In the console window, I get this:

(process 42000) exited with code -1073741819.

I have tried everything I have found here on stack and on Microsoft community.

Restarted VS, Restarted computer, reinstalled .NET 8 SDK, reinstalled VS, even tried to open need solution with no code in it beside "HELLO WORLD"

But nothing is working.

Please advice

Update #1 - .csproj file:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup Label="Globals">
    <SccProjectName>SAK</SccProjectName>
    <SccProvider>SAK</SccProvider>
    <SccAuxPath>SAK</SccAuxPath>
    <SccLocalPath>SAK</SccLocalPath>
  </PropertyGroup>

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <PlatformTarget>AnyCPU</PlatformTarget>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <Optimize>True</Optimize>
  </PropertyGroup>

  <ItemGroup>
    <Compile Remove="Properties\**" />
    <EmbeddedResource Remove="Properties\**" />
    <None Remove="Properties\**" />
  </ItemGroup>

  <ItemGroup>
    <None Remove="appSettings.json" />
  </ItemGroup>

  <ItemGroup>
    <Content Include="appSettings.json">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="EPPlus" Version="4.5.3.3" />
    <PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.0" />
    <PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
    <PackageReference Include="Microsoft.Graph" Version="5.44.0" />
    <PackageReference Include="Microsoft.Graph.Core" Version="3.1.8" />
    <PackageReference Include="System.Diagnostics.EventLog" Version="8.0.0" />
  </ItemGroup>

  <ItemGroup>
    <None Update="MailTemplates\File.html">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>

</Project>

Update2 - the cause Eset anti virus is to blame. Their deep inspection module stoped all cmd functionality in the computer

1

There are 1 best solutions below

0
SimpleSheep On

First time post and possibly not related.

We had issues since 9PM yesterday (07/03/24) with Exchange IIS and .NET Same Exception code.

Turns out to be our Trellix ATP being the cause, still troubleshooting now. If you have ATP might be worth disabling it to test.

Update: Simply running update now in Trellix ENS resolved our issue and ATP is now enabled again. No more access violation errors for .NET