用Visual Studio 2022打开发布我的Blazor Server App后,网页打不开。我得到 FileNotFoundException。如何解决?

问题描述 投票:0回答:0

我有一个使用 Visual Studio 2019 (.NetCore 3.1) 创建的 Blazor 服务器端应用程序。到目前为止,该应用程序运行良好。我将我的 Visual Studio 更新到 2022。打开项目后,我注意到 Framework 设置为 .Net 6.0,因此我将其手动更改为 .NetCore 3.1 并发布了项目,没有任何错误。

但是当我试图打开网页时,不幸的是我的浏览器出现了以下错误。我能知道什么?我刚刚将 Visual Server 更新到 2022,没有别的。

FileNotFoundException:无法加载文件或程序集“System.Runtime,Version=6.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”。系统找不到指定的文件。

System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'System.Runtime, Version=6.0.0.0, Culture=neutral,  PublicKeyToken=b03f5f7f11d50a3a'

at System.Text.Json.JsonReaderHelper.IndexOfOrLessThan(Byte& searchSpace, Byte value0, Byte value1, Byte lessThan, Int32 length)
at System.Text.Json.Utf8JsonReader.ConsumeString()
at System.Text.Json.Utf8JsonReader.ConsumePropertyName()
at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
at System.Text.Json.Utf8JsonReader.Read()
at System.Text.Json.JsonDocument.Parse(ReadOnlySpan`1 utf8JsonSpan, Utf8JsonReader reader, MetadataDb& database, StackRowStack& stack)
at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory`1 utf8Json, JsonReaderOptions readerOptions, Byte[] extraRentedBytes)
at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory`1 json, JsonDocumentOptions options)
at System.Text.Json.JsonDocument.Parse(String json, JsonDocumentOptions options)
at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.ParseStream(Stream input)
at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream)
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info)
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load()
at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration()
at Microsoft.Extensions.Hosting.HostBuilder.Build()
at WebApplication7.Program.Main(String[] args) in W:\00_md91bu_Projects\30_ConCheetahPortal_Blazor\WebApplication7\Program.cs:line 23
c# visual-studio-2019 blazor-server-side visual-studio-2022 filenotfoundexception
© www.soinside.com 2019 - 2024. All rights reserved.