我在日志文件中发现以下错误:
写入记录器时发生错误。无法加载文件或程序集'System.Core,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'。不应加载引用程序集以执行。它们只能在Reflection-only loader上下文中加载。 (HRESULT异常:0x80131058)
如果发生异常,我们会将详细信息写入azure blob存储中的文件中。每天一个文件。 每次都不会发生此异常,有时只是..
有人知道这个问题吗? 我们正在使用以下套餐:
<PackageReference Include="AspNet.Security.OAuth.Introspection" Version="1.0.0" />
<PackageReference Include="AspNet.Security.OAuth.Validation" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.5" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.1.5" />
<PackageReference Include="OpenIddict" Version="1.0.0-rc2-0784" />
<PackageReference Include="OpenIddict.Core" Version="1.0.0-rc2-0784" />
<PackageReference Include="OpenIddict.EntityFrameworkCore" Version="1.0.0-rc2-0784" />
<PackageReference Include="OpenIddict.Mvc" Version="1.0.0-rc2-0784" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.1.5" />
<PackageReference Include="System.Text.Encodings.Web" Version="4.3.1" />
<PackageReference Include="Swashbuckle" Version="6.0.0-beta902" />
<PackageReference Include="Serilog" Version="2.6.0" />
<PackageReference Include="Serilog.Sinks.AzureTableStorage" Version="4.0.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="2.0.2" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.4" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="System.Net.Security" Version="4.3.2" />
和
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="1.1.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="1.1.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.5" />
<PackageReference Include="System.Text.Encodings.Web" Version="4.3.1" />
<PackageReference Include="System.Net.Http" Version="4.3.2" />
<PackageReference Include="OpenIddict" Version="1.0.0-rc2-0784" />
<PackageReference Include="System.Net.Security" Version="4.3.1" />
和
<PackageReference Include="WindowsAzure.Storage" Version="7.2.1" />
感谢您的帮助! :)
答案 0 :(得分:1)
在here之前发生了类似的线程 根据您的环境,有几种类型的解决方案。
有些用户可以通过执行以下操作来解决问题:
Deleting \bin and \obj folders before publishing
Deleting my folder that I publish to
Resetting IIS
Making sure that the ApplicationPoolIdentity's .NET CLR version is set to "No Managed Code"