Could not load file or assembly 'netstandard' or one of its dependencies when publishing in Hostgator

0

My web app works fine in my development machine, but when I published in web via Hostgator, it gives me this error consistently:

[BadImageFormatException: Could not load file or assembly 'netstandard' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +225 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +110 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +22

[ConfigurationErrorsException: Could not load file or assembly 'netstandard' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +725 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +247 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +157 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +226 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +73 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +319 System.Web.Compilation.BuildManager.ExecutePreAppStart() +170 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +820

[HttpException (0x80004005): Could not load file or assembly 'netstandard' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +523 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +107 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +688

I already added netstandard as reference in the web project. The assembly was also part of the dlls uploaded in the domain.

This web application by the runs in my azure free account.

Is there anybody who experienced this error?

BR, Jess

c#
.net
model-view-controller
asked on Stack Overflow Mar 2, 2021 by user1505676

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0