-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use "new" library in .net 4.8 #4735
Comments
This is by design. When you are writing code against .NET Core/.NET, you get more API's available (we have some async Task based api's only available on Core), when targetting netstandard, you get the api's which are available on all supported platforms, so .NET Core/.NET and .NET Framework. On .NET Framework you get the api's that are available there, which is all of them. The second issue is a bit more interesting. I believe it would work, but you would need to pull apart the packages and either directly reference the various pieces or build your own. I think simply removing the net461 (might be net462, I forget which version it is, but it will be obvious) in all the folders should be sufficient. As for creating a netstandard2.0 separate library, the way classic .NET Framework projects handle transitive dependencies is different than dotnet SDK projects. Can you try experimenting with using an SDK style project targeting .NET Framework (e.g. TargetFramework is net472) with a project reference to the netstandard2.0 SDK style project? I would expect the netstandard2.0 library to correctly reference the nuget reference assembly. It will still use .NET Framework at runtime though, but compilation should reference the correct reference assemblies in this case. |
While I can understand the mentality behind this statement, it somehow feels still strange to me. I don't expect that my request will likely change much there but I still would like to share my thoughts on this topic. Maybe it triggers some interesting discussion or I might learn some stuff 😁 😉 The .net framework in this list does somehow not fit into the "line" of the other two ones (.net core and .net standard): The .net framework version of WCF is not maintained within this repository while the other two are. If all 3 versions of the library would be built from this codebase and different sets of features would be exposed this statement makes more sense. But the fact that the NuGet packages of this new library are only redirects to a "different" library, the packages do not add much value and in parallel prevent anyone targeting still .net framework from really using the code developed here. 🤔 I might be a bit distant to this approach, but I also don't see much value in this practice: Why reference a default .net library (available through This library shares a common conceptual root with the client part of the classical WCF but from what I've seen. the differences are actually quite significant. A change in your target framework actually introduces breaking changes even though you reference the same version of the Bringing also CoreWCF onto the stage for discussion, it gets even more complicated because CoreWCF does not forward to the classical WCF. It follows a different mentality of providing a migration path to the future. "Drop the old default .net framework libs and integrate the new ones and then you're set for a change in your target framework" - so to say 😁 I would have loved to see there a consistent approach.
I gave this one a try using the
This is more what I have thought about as temporary workaround for our migration path. We are operating company internal NuGet repositories and it might be easier to re-package the assemblies from NuGet.org only including .net core (and above) and .net standard libs. With a regular CI/CD trigger checking for changes on NuGet it should be fairly easy to stay up to date. Nevertheless I preferred the path of reaching out to the package authors to address this issue at the root instead of establishing custom workarounds. Still, this path seems to be a possible workaround for us.
We are already using SDK style csprojs for all our projects and we are only using This is bit a cascading issue in our case. We're aiming for a stepwise migration replacing our legacy components in an iterative approach. Some components hold us back to net48 until we migrated away from all, but to migrate away, components like dotnet/wcf expect us already to change to .net 5/6 to really migrate. "chicken-egg-problem" 😅 |
Could you split the client code into a separate project which targets .NET Standard? It might be possible to run integration tests using it on .NET to validate the features you need are there. One piece of advice I will give which you might not hit until too late is to go 100% async with WCF. We removed the sync implementation in the WCF Core client internally so the sync api's are all sync over async and can cause you scalability problems with extra threads. This isn't a problem with something like a desktop UI app, but for a middleware scenario, it can have an impact. Also explicitly open your channels before using them, and if using anything other than BasicHttpBinding or NetHttpBinding, open it async. As you can see, even if we made it so you could use the .NET Core implementation on .NET Framework, you still won't see the same behavior as you would on .NET Core as our dependencies would have different behaviors. It's not an ideal situation, but it's the best of a set of possible solutions each with their own consequences. I try everything I can to get consistent behavior as far as possible though. |
Close this as no new response. Feel free to re-activate if that is not the case. |
Describe the bug
Currently the NuGet libraries provided by this project for .net 4.8 are forwarding the implementation to the System.ServiceModel coming with .net 4.8 itself. This makes migration really hard because there is no good way to already start using dotnet/wcf + CoreWCF already.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
We need a way to enforce usage of the new client-side-only libraries through NuGet without pulling the full-framework WCF including the server parts.
Screenshots
Additional context
We cannot yet change our project to actually be .net5.0 or .net6.0 due to a bigger scale rework ongoing which we need to do gradually across all our company wide products and libraries. We would like to first migrate to the new CoreWCF for Server and System.ServiceModel NuGets for client but stay on .net4.8.
Even if we make a .netstandard2.0 library project and consume the nugets and then use it in our main .net 4.8 application, the main application still pulls/references the .net 4.8 WCF libs.
NuGet does not provide a proper way to force usage of .netstandard2.0 libs for individual packages. There are only hacks where you need to spoil your whole solution tree with additional custom references. Therefore my hope lies here on the package authors side to provide a way to consume the new packages and provide a migration path away from the full framework WCF.
The text was updated successfully, but these errors were encountered: