question

PrathameshShende avatar image
0 Votes"
PrathameshShende asked ZhiLv-MSFT commented

after publish to server getting error

my website is works fine before. So I made some changes in website and also update the packages too.

after publishing into my server showing me this error.

website is asp.net core webapi with blazor wasm

crit: Microsoft.AspNetCore.Hosting.Diagnostics[6]
Application startup exception
System.IO.FileLoadException:
File name: 'Microsoft.EntityFrameworkCore, Version=5.0.11.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at Books.Server.Startup.ConfigureServices(IServiceCollection services)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c_DisplayClass9_0.<Invoke>gStartup|0(IServiceCollection serviceCollection)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c
DisplayClass8_0.<Build>b0(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services, Object instance)
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c
DisplayClass15_0.<UseStartup>b1(IApplicationBuilder app)
at Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter.<>c
DisplayClass4_0.<Configure>b0(IApplicationBuilder app)
at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c
DisplayClass0_0.<Configure>b_0(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://127.0.0.1:35136
crit: Microsoft.AspNetCore.Hosting.Diagnostics[11]
Hosting startup assembly exception
System.InvalidOperationException: Startup assembly Books.Server failed to execute. See the inner exception for more details.
---> System.IO.FileLoadException:
File name: 'Microsoft.AspNetCore.Identity.UI, Version=5.0.11.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(MetadataToken caCtorToken, MetadataImport& scope, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1& derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctorWithParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1 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.Reflection.CustomAttributeExtensions.GetCustomAttributes[T](Assembly element)
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.ExecuteHostingStartups()
--- End of inner exception stack trace ---
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]

getting this log what is the exact issue I tried 2 3 times to publish but getting this error . so my website showing 500 error because of this

dotnet-aspnet-core-blazor
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi PrathameshShende,

After modifying the website, whether it works well on local environment?

Hosting startup assembly exception
System.InvalidOperationException: Startup assembly Books.Server failed to execute. See the inner exception for more details.

From the exception, it seems that there has an exception on the Books.Server and it might relate the Identity, please check it.

Besides, if the website works well on the local environment, which kind of server the website deployed/hosted?

0 Votes 0 ·

not working on local too. but i will look into this. maybe the issue with publish files

0 Votes 0 ·

Hi @PrathameshShende,

After modifying the website, if it also not working locally, the issue does not relate the publish files. You'd better check the updated part of code, is there any exception, try to set the debugger to debug the application locally. Besides, you can also check the update package, whether it is compatible or not?

0 Votes 0 ·

0 Answers