Click here to Skip to main content
16,017,986 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi , Im creating core 2.0 web api application. When I execute the api from VS. Its working fine also I can see all the api's in swagger. But when I do publish and deploy the same in IIS 10.0 version. I can see below errors unfortunately I dont use the reference anywhere in my project also I tried to find the same version in nuget but there is no such kind of version available. Can you help me to resolve both errors which im getting

An error occurred while starting the application.
FileNotFoundException: Could not load file or assembly 'System.Private.ServiceModel, Version=4.1.2.4, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
Unknown location

FileNotFoundException: Could not load file or assembly 'System.Private.ServiceModel, Version=4.1.2.4, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
Unknown location

ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)

Loader Exceptions:
Could not load file or assembly 'System.Private.ServiceModel, Version=4.1.2.4, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
Could not load file or assembly 'System.Private.ServiceModel, Version=4.1.2.4, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
FileNotFoundException: Could not load file or assembly 'System.Private.ServiceModel, Version=4.1.2.4, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

Show raw exception details
FileNotFoundException: Could not load file or assembly 'System.Private.ServiceModel, Version=4.1.2.4, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

Show raw exception details
ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)



System.Reflection.RuntimeAssembly.get_DefinedTypes()
Microsoft.AspNetCore.Mvc.Controllers.ControllerFeatureProvider.PopulateFeature(IEnumerable<ApplicationPart> parts, ControllerFeature feature)
Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateFeature<TFeature>(TFeature feature)
Microsoft.Extensions.DependencyInjection.MvcCoreMvcBuilderExtensions.AddControllersAsServices(IMvcBuilder builder)
AetnaNHub.Startup.ConfigureServices(IServiceCollection services) in Startup.cs
+
      services.Configure<IISOptions>(options =>
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()


What I have tried:

Could not load file or assembly 'System.Private.ServiceModel, Version=4.1.2.2 · Issue #2824 · dotnet/wcf · GitHub[^]
Posted
Updated 5-Sep-18 10:47am
v2
Comments
Matias Lopez 7-Sep-18 13:58pm    
Did you upload .html, .asp, or .aspx, the bin folder, Web.Config, and needed files to deploy the Web? What kind of page did you upload?
sencsk 18-Nov-21 4:16am    
Its .Net Core Api 2.0. In the bin directory found only publish files. Local system its working fine but it's failing when we move to a different server.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900