简体   繁体   English

Asp Core新项目引发与“ System.Private.CoreLib”有关的异常

[英]Asp Core new project throws exceptions related to “System.Private.CoreLib”

I am currently working with Asp Net Core project. 我目前正在使用Asp Net Core项目。 When I start the project I get a few exceptions like this: 当我启动项目时,我会遇到一些类似的异常情况:

在此处输入图片说明

If I expand one of them to see the details this is what appears: 如果我展开其中一个以查看详细信息,则会显示以下内容:

在此处输入图片说明

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 . 在SDK版本2.1.3和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: 顺便说一句,这是.csproj文件:

<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? 可以是VS错误吗? I am using this version: 15.5.2 (Enterprise 2017) If I add other dependencies eg EF Core, I will have more of those errors. 我正在使用此版本: 15.5.2 (Enterprise 2017)如果添加其他依赖项(例如EF Core),则会出现更多此类错误。

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. 所有这些异常都是与框架相关的异常,这些异常在内部引发和捕获。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 UWP App RequestRestartAsync在System.Private.Corelib中引发异常 - UWP App RequestRestartAsync Throws Exception in System.Private.Corelib 无法加载文件或程序集“ System.Private.CoreLib…” - Could not load file or assembly 'System.Private.CoreLib…' Azure函数:system.private.corelib:执行函数时发生异常 - Azure Function : system.private.corelib : exception while executing function Azure Function:System.Private.CoreLib:无法加载文件或程序集“System.ComponentModel.Annotations...” - Azure Function: System.Private.CoreLib: Could not load file or assembly 'System.ComponentModel.Annotations…' .Net Standard 4.7.1 在序列化期间无法加载 System.Private.CoreLib - .Net Standard 4.7.1 Could not load System.Private.CoreLib during serialization System.TypeLoadException:无法从程序集“System.Private.CoreLib”加载类型“System.Object”,因为父级不存在 - System.TypeLoadException: Could not load type 'System.Object' from assembly 'System.Private.CoreLib' because the parent does not exist 无法加载文件或程序集“System.Private.CoreLib,Version=4.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e” - Could not load file or assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' C#.NET Core如何在System.Private.CoreLib.dll中调试System.IO.FileNotFoundException? - C# .NET Core How to debug System.IO.FileNotFoundException in System.Private.CoreLib.dll? .NET 核心 - System.Private.CoreLib.dll 与 System.Runtime - .NET Core - System.Private.CoreLib.dll vs System.Runtime 抛出异常:System.Private.CoreLib.dll 中的“System.MissingMethodException” - Exception thrown: 'System.MissingMethodException' in System.Private.CoreLib.dll
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM