question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

System.ServiceModel.Http not found with dotnetcore 2.0

See original GitHub issue

After upgrading my project from 1.1 to core 2.0 getting the following error when serving under IIS. Never had this in 1.1.

System.IO.FileNotFoundException: Could not load file or assembly 'System.ServiceModel.Http, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.ServiceModel.Http, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
   at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
   at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit)
   at System.Reflection.CustomAttributeExtensions.GetCustomAttributes[T](Assembly element)
   at Microsoft.AspNetCore.Mvc.Razor.Compilation.ViewsFeatureProvider.GetViewAttributes(AssemblyPart assemblyPart)
   at Microsoft.AspNetCore.Mvc.Razor.Compilation.ViewsFeatureProvider.PopulateFeature(IEnumerable`1 parts, ViewsFeature feature)
   at Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateFeature[TFeature](TFeature feature)
   at Microsoft.AspNetCore.Mvc.RazorPages.Internal.CompiledPageRouteModelProvider.GetViewDescriptors(ApplicationPartManager applicationManager)
   at Microsoft.AspNetCore.Mvc.RazorPages.Internal.CompiledPageRouteModelProvider.EnsureCache()
   at Microsoft.AspNetCore.Mvc.RazorPages.Internal.CompiledPageRouteModelProvider.OnProvidersExecuting(PageRouteModelProviderContext context)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionDescriptorProvider.BuildModel()
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ActionDescriptorCollectionProvider.UpdateCollection()
   at Microsoft.AspNetCore.Mvc.Internal.ActionDescriptorCollectionProvider.get_ActionDescriptors()
   at Microsoft.AspNetCore.Mvc.Internal.AttributeRoute.GetTreeRouter()
   at Microsoft.AspNetCore.Mvc.Internal.AttributeRoute.RouteAsync(RouteContext context)
   at Microsoft.AspNetCore.Routing.RouteCollection.<RouteAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Zenith.Web.Middleware.UserTokenMiddleware.<Invoke>d__3.MoveNext() in C:\Projects\Client Data Management\Test\Zenith\Zenith.Web\Middleware\UserTokenMiddleware.cs:line 46
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.<Invoke>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Zenith.Web.Startup.<>c.<<Configure>b__10_0>d.MoveNext() in C:\Projects\Client Data Management\Test\Zenith\Zenith.Web\Startup.cs:line 87
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.<Invoke>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame`1.<ProcessRequestsAsync>d__2.MoveNext()

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:17 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
k11k2commented, Oct 20, 2017

Install System.ServiceModel.Http package.

1reaction
alanjudencommented, Oct 19, 2017

@cgountanis & @ctrl-brk,

I don’t use the .NetCore version as my daily driver (only created it to help the community and get my hands into NetCore). I’ll have to try upgrading my project and see if I run into the same issue or not. I’m also not sure what upgrading would do to all the people running on the version 1.1 framework and using my library. I’ll have to do some testing on this. Sorry I can’t be more help at the moment.

Alan

Read more comments on GitHub >

github_iconTop Results From Across the Web

System.ServiceModel not found in .NET Core project
A library of mine has "System.ServiceModel.Http" and works when directly integrated. When I add it as Nuget package, I also need to add...
Read more >
System.ServiceModel not found in .NET Core project-.net-core
4-integrate asmx service by command svcutil http://abctest.asmx (.asmx url) inside inside clienthotel folder. 5-it will create .cs class and output.config file ...
Read more >
System.ServiceModel.Http 6.0.0
Provides the types that permit SOAP messages to be exchanged using Http (example: BasicHttpBinding).
Read more >
Client Support for Calling WCF/CoreWCF with System. ...
System.ServiceModel.* are a set of NuGet packages that provide the client functionality for calling into WCF or CoreWCF services from .
Read more >
Troubleshoot .NET Framework targeting errors
This article provides resolutions for MSBuild errors that might occur because of reference issues.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found