-
Notifications
You must be signed in to change notification settings - Fork 428
.NET Standard 2.0 / .NET Framework 4.6.1 Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified. #575
Comments
I am also having this problem. It seems there is a lack of information on this specific issue. I stopped referencing the .net 4.6.1 version of System.ServiceModel and instead referenced the System.ServiceModel.Primitives, System.ServiceModel.Http, System.ServiceModel.Web and System.ServiceModel.Security nuget packages that are supposed to be compatible. This did not work for me as the WsHttpBinding does not seem to exist anywhere. I thin I am going to have to downgrade my project to use the 4.6.1 framework instead of the .net standard. Unless someone can assist.... |
Did you add a reference to the Service Model packages in your .NET Core project? I'm not sure exactly which ServiceModel Api you rely on, but the available packages are:
They will contain the .NETCore implementation of the API plus also the shim of System.ServiceModel.dll that you will need in order to be able to correctly type forward the type. |
I'll will check back on monday, but from what i remember, i linked the libraries to my .NET Core and .NET Standard project. |
I know that the System.ServiceModel.dll shim was added recently, so it's possible that the version of the packages that you are referencing don't have it. Can you check if you are referencing the latest released packages for ServiceModel? cc: @shmao |
I am not using net.tcp or duplex so I did not add those. I am using the most recent nuget packages that are available and the include pre-release flag was checked |
can you confirm which version of the Primitves package contain the shim? Even if they are prerelease it's fine. |
The latest build from MyGet contains the shim. For example, https://dotnet.myget.org/feed/dotnet-core/package/nuget/System.ServiceModel.Primitives/4.5.0-preview2-25910-01 |
yeah but what about nuget.org? since this is for a customer it's better to point them to shipped packages and not daily builds. |
We haven't shipped any packages containing that shim on nuget yet. It was only shipped as part of the meta-package for UWP6.0. |
The System.ServiceModel.dll shim has been ported to 2.0 and will be released to nuget.org sometime soon (weeks) (dotnet/wcf#2375). |
Thank you all! Thnx again all :) |
@WalterEbbers we just released to nuget.org an update of https://www.nuget.org/packages/System.ServiceModel.Primitives/4.4.1-servicing-25917-01 |
Thank you for the update! System.TypeLoadException: 'Could not load type 'System.ServiceModel.Channels.RemoteEndpointMessageProperty' from assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.' I made a small test solution, with a .net core console app, .net standard 2.0 library and a .net framework 4.6.1 project. The .NET Core and .NET Standard project both reference the new nuget package. The stripped down .NET Framework 4.6.1 only has a method wich calls the OperationContext.Current.IncomingMessageProperties with RemoteEndpointMEssageProperty.Name as a key. This fails. |
@WalterEbbers thanks for trying the package. Unfortunately, type |
Thnx for the reply. |
We currently do not have plan to add this API in any of the future release. But we would definitely consider to add the API if we see more user usage. |
I see, understandable :) Thnx all for the help! |
I was running into this problem with the Could Not Load System.ServiceModel Assembly exception while connecting to .NET Framework 4.0 libraries from a console .NET Core 2.0 project, and the Nuget System.ServiceModel.Primitives package on my .NET Core 2.0 project resolved it. |
@tompartridge there is a stable version released already https://www.nuget.org/packages/System.ServiceModel.Primitives/4.4.1. If this still does not work for you, could you please open a new issue at WCF repo (https://github.com/dotnet/wcf/issues/new) and share a step by step repro? |
I think that's related. |
@shmao will be good to see this package in .netstandard |
Hi,
I have a .NET Standard 2.0 library which references a few NET 4.6.1 libraries.
The .NET Standard library will be used in a .NET Core web application.
The .NET 4.6.1 Framework uses library 'System.ServiceModel.dll' for WCF calls.
I try to do the following.
My .NET Core webapp goes to the .NET Standard library which calls something from my .NET Framework 4.6.1 project. But at that moment i get the following error:
'Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.'
The 'System.ServiceModel.dll' is referenced as a assemblyreference in the .NET Standard project and the .NET Core webapp.
I really thought that this would work but sadly it doesn't. Is this a issue with the .NET libraries?
Do i need to change things in my .NET Standard / Core project?
Thnx in advance :)
Walter
The text was updated successfully, but these errors were encountered: