George Vasilchenko
George Vasilchenko

Reputation: 141

Asp Core new project throws exceptions related to "System.Private.CoreLib"

I am currently working with Asp Net Core project. When I start the project I get a few exceptions like this:

enter image description here

If I expand one of them to see the details this is what appears:

enter image description here

It seems that there are some files not being loaded by the runtime. This happens in the SDK version 2.1.3 and Net.Core 2.0.4. I upgraded/downgraded all these dependencies but had no luck, the errors kept showing up. The errors are not blocking the process unless I explicitly set the exception settings to throw those.

Btw, here is the .csproj file:

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

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Folder Include="wwwroot\" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
  </ItemGroup>

  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
  </ItemGroup>

</Project>

The question is why is this happening and how to solve this issue? It appears that it is not harmful but any error should not be tolerated imho.

Can it be a VS bug? I am using this version: 15.5.2 (Enterprise 2017) If I add other dependencies e.g. EF Core, I will have more of those errors.

Upvotes: 0

Views: 1660

Answers (1)

George Vasilchenko
George Vasilchenko

Reputation: 141

This all appears to be a default behavior in case "Just my code" is not enabled. All these exceptions are framework-related exceptions that are being thrown and caught internally.

Upvotes: 4

Related Questions