追加してみました
_<PackageReference Include="Microsoft.AspNetCore.Razor.Runtime" Version="2.2.0" />
_
ただし、2.2.0は現時点で入手可能な最新バージョンであり、エラーと一致しません。アプリを再構築した後もエラーは同じです。
project.csproj:
_<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="3.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.1.0" />
</ItemGroup>
</Project>
_
完全なエラー:
未処理の例外。 System.IO.FileNotFoundException:ファイルまたはアセンブリ 'Microsoft.AspNetCore.Razor.Runtime、Version = 3.1.1.0、Culture = neutral、PublicKeyToken = adb9793829ddae60'を読み込めませんでした。システムは、指定されたファイルを見つけることができません。
ファイル名: 'Microsoft.AspNetCore.Razor.Runtime、Version = 3.1.1.0、Culture = neutral、PublicKeyToken = adb9793829ddae60' at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module、Int32 typeToken、RuntimeTypeHandle [] typeInstantiationContext、RuntimeTypeHandle [] methodInstantiationContext) System.Reflection.CustomAttribute.FilterCustomAttributeRecord(MetadataToken caCtorToken、MetadataImport&scope、RuntimeModule装飾モジュール、メタデータトークン装飾トークン、ランタイムタイプ属性フィルタータイプ、ブール型mustBeInheritable、ListBuilder
1& derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder
1&属性、RuntimeModule装飾モジュール、Int32装飾メタデータトークン、RuntimeType属性フィルタータイプ、ブールmustBeInheritable、ListBuilder1 derivedAttributes) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly Assembly, RuntimeType caType) at System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit) at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit) at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit) at System.Reflection.CustomAttributeExtensions.GetCustomAttribute[T](Assembly element) at Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartFactory.GetApplicationPartFactory(Assembly Assembly) at Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateDefaultParts(String entryAssemblyName) at Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.GetApplicationPartManager(IServiceCollection services) at Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.AddMvcCore(IServiceCollection services) at Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddControllersCore(IServiceCollection services) at Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddControllersWithViewsCore(IServiceCollection services) at Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddControllersWithViews(IServiceCollection services) at Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddMvc(IServiceCollection services) at Microsoft.AspNetCore.Identity.IdentityBuilderUIExtensions.AddRelatedParts(IdentityBuilder builder) at Microsoft.AspNetCore.Identity.IdentityBuilderUIExtensions.AddDefaultUI(IdentityBuilder builder) at Microsoft.Extensions.DependencyInjection.IdentityServiceCollectionUIExtensions.AddDefaultIdentity[TUser](IServiceCollection services, Action
1 configureOptions)at Microsoft.Extensions.DependencyInjection.IdentityServiceCollectionUIExtensions.AddDefaultIdentity [TUser](IServiceCollection servic es)/home/juan/code/web-projects/pieshop/src/Startup.cs:line 36のpieshop.Startup.ConfigureServices(IServiceCollection services)でSystem.RuntimeMethodHandle.InvokeMethod(Object target、Object []引数、署名でsig、ブールコンストラクタ、ブールwrapExceptions)at System.Reflection.RuntimeMethodInfo.Invoke(Object obj、BindingFlags invokeAttr、Binderinder、Object [] parameters、CultureInfoculture)
Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance、IServiceCollection services)at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder。<> c__DisplayClass9_0.g__Startup | 0(IServiceCollection serviceCollection)at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder .Invoke(Object instance、IServiceCollection services)at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder。<> c__DisplayClass8_0.b__0(IServiceCollection services)at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType、HostBuilderContext context、IServiceCollection services)at Microsoft。 AspNetCore.Hosting.GenericWebHostBuilder。<> c__DisplayClass12_0.b__0(HostBuilderContext context、IServiceCollection services)at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()at Microsoft.Extensions.Hosting.HostBuilder.Build()at pieshop.Program.Main(String [] args)/home/juan/code/web-projects/pieshop/src/Program.cs:line 10
Startup.csの36行目:
_services.AddDefaultIdentity<IdentityUser>()
.AddEntityFrameworkStores<AppDbContext>();
_
解決しました! dotnetパッケージを次の順序で個別にアンインストールしました:dotnet-sdk-bin(AUR)dotnet-runtime-bin(AUR)dotnet-Host-bin(AUR)
次に、同じパッケージを逆の順序でビルドしました。現在、これらはすべて現在3.1.1.sdk101-2にあり、私のプロジェクトは再び実行されています。
問題は、ASP.NET Core Identity Packagesの最新の3.1.1リリースにあります。以前の安定した3.1.0バージョンに戻すと正常に動作します。以下のスナップショットを参照してください:
私には、最新のSDKとCore Runtimeをインストールしても問題は解決しませんでした。