Open leon-tliang3 opened 1 year ago
This looks like it's caused by a breaking change in the 6.* version of WCF client packages, documented at https://learn.microsoft.com/en-us/dotnet/core/compatibility/wcf-client/6.0/net-standard-2-support , you can refer to the document's Recommended action section to resolve the issue.
Thanks Carol. I removed references to the System.ServiceModel.Duplex and System.ServiceModel.Security from the .net application reference list below, but it still has the same issue... Do you know why?
As the document indicated, I think you'll need to multi-target your WCF libraries in your project file. Specifically, add a conditional assembly reference to System.ServiceModel.dll for .NET Framework and conditionally add package references to WCF Client packages for .NET.
For example:
Please forgive me, I'm new here. I changed the .csproj file of the .net application to the following, but it still has the same error...
Sorry to hear that the issue persists. Is it possible for you to share a sample repro project?
Let me briefly describe the project first, if it needs to the source code, I will split it out my solution.
@leon-tliang3 Thanks for the update. I was able to reproduce the issue by creating a client project targeting net6.0, which referenced a net4.8 project and the wcf library was used in the net4.8 project. Do you think updating target of the net4.8 project to netstandard2.0 is an acceptable workaround? From what I understand, when a net6.0 project references a net4.8 project, compatibility between them cannot be guaranteed.
@imcarolwang Thanks for your quick response. From what I understand, System.ServiceModel.Primitive target only .NET 6. Library projects. If .net4.8 has the compatible issue with .net 6.0 when reference this NuGet package, why there is no compatible issue between .net6.0 and netstandard2.0? Besides, I‘m afraid I cannot update net4.8 project to netstandard2.0, because that is take a lot of effort to do that, Is there any other workarounds? Or will MS fix this issue in future version of System.ServiceModel.Primitive? Maybe be 7.0 or 8.0?
Regarding why there is no compatible issue between .net6.0 and netstandard2.0?
This document might be helpful to answer the question, it's because net6.0 implemented netstandard2.0.
@imcarolwang I saw that it removed the support for .netstandard2.0 from WCF Client v6.0 in section Reason for change in document.
The change to remove support for .NET Standard was made so that WCF Client and WCF Client apps can take advantage of the new features and APIs available in .NET 6 and later versions.
I don't know if this is what I understand. But this is not the point, I mean even net48 and netstandard2.0 are compatible, I probably wouldn't be able to update it. I just would like to know if there any other workarounds besides this? It's really important for me. Thank you in advance.
Is there any update?
In my case, I have dotnet 8 reference to a framework4.8 project. The error remained even I have system.servicemodel.promitives installed. End up, I have downgraded system.servicemodel.promitives from v8 to v4.10.3 (the latest for v4)
@hankpotter system.servicemodel.promitives 4.10.3 only support .net 6.0, but not .net 8.0, but .net 6.0 will end to support on Nov 12, 2024.
I do not use servicemodel in .net 8. It is required to include in .net 8 in order to call a function inside framework4.8..
I have tried servicemodel v8 and v6. Only v4.10.3 can get rid of the following error Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0
@hankpotter, I'm working on a solution for this. We've extended the support date for the 4.10.3 version so that there's a supported version available for this scenario.
Hi, we also encountered the problem. Will there be a fix soon?
Hi, is there any news on the current development status?
@mconnew is there any update? And I know that you extends the end of support date for WCF Client 4.10 until November 12, 2024, but I would like to know that is there any possible to extend the date further? Because if there is no suitable solution, we may need enough time to migrate the code from .NET Framework to .NET.
Describe the bug 'Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.'
To Reproduce Steps to reproduce the behavior:
Expected behavior It should be worked just like v4.10.2 after upgrading the wcf library components to v6.0.0.
Screenshots