.NET 8 is just around the corner and has developers looking to migrate from .NET Framework. Problem is, they have no idea what to do with their Windows Communication Foundation (WCF) applications.
Microsoft has deprecated WCF with the release of .NET 5 and advises developers to transition to more modern technologies.This is bad news for those with WCF applications who wish to migrate to .NET5+ (.NET 5 to .NET 8).
However, if you have WCF applications, there’s no need to panic or feel overwhelmed! Migrating your existing applications to CoreWCF is easy, and is now supported by Microsoft.
In this article, we’ll delve into either migrating your applications to CoreWCF or rewriting your applications to target modern frameworks. On that note, CoreWCF isn’t recommended for new applications. Microsoft recommends that you move to modern technologies if you’re starting from scratch.
What Has Happened to WCF?
As of the release of .NET 5, WCF is basically deprecated. While it will still work with .NET Framework for years to come, it won’t be supported in .NET5+.
Microsoft’s original plan was to phase out WCF with the release of .NET 5. They were encouraging developers to move on to more modern frameworks. However, this didn’t sit too well with developers who relied on WCF for their applications. Especially when migrating to .NET5+. This meant a lot of developers stuck with .NET Framework to avoid the hassle.
Fortunately, the developer community stepped in and created CoreWCF. This was intended as a “stop gap” to help bring WCF-based apps to .NET5+.CoreWCF got really popular, developers loved it! So, Microsoft ended up embracing this path for WCF to .NET5+. And they now provide official support for CoreWCF.
So, what do I do about my WCF Apps?
Those who are migrating to .NET5+ have two choices:
- Migrate their applications to CoreWCF
- Rewrite and Target a modern framework such as gRPC or ASP NET Core Web API
Migrating to CoreWCF
CoreWCF was created to address the need for WCF functionality on .NET5+ that didn’t natively support WCF. It aimed to bring features and capabilities that would allow developers to build and consume SOAP-based services using the WCF programming model. Once a community-driven project introduced in 2019, Microsoft began supporting it on it’s release of 1.0 in April 2022.
Why should I migrate my apps to CoreWCF?
- WCF/CoreWCF is a good choice for applications that are pretty big or have client dependencies.
- The bottom line for many is that it will allow them to continue using WCF for as long as necessary.
- Logistically, migrating to CoreWCF is easier and requires way less effort compared to complete rewriting.
Is this a good long-term solution?
- Migrating to CoreWCF might not be the best move for long-term solutions.
- As it stands, the fact is WCF has been deprecated by Microsoft and CoreWCF receives limited attention.
- Looking at the big picture, emerging technologies are likely to surpass CoreWCF’s capabilities in the future.
- Also, consider that as time goes on, we’ll see a shortage of skilled professionals familiar with CoreWCF, as both seasoned and new developers embrace more modern frameworks.
It’s probably best to at least formulate plans for a potential rewrite in the future, as it might become easier to do so sooner rather than later.
Rewriting your Apps
So, you’ve made the decision to rewrite your applications or are considering planning for the future. Next step is to make the important choice of what framework to go with.
There are two popular frameworks you can consider for your application rewrite:
- gRPC: An open-source framework developed by Google for building cross-platform, and language-agnostic remote procedure call (RPC) APIs, often used in microservices architecture and distributed systems.
- ASP NET Core Web API: Used for building HTTP-based, RESTful services using the ASP.NET Core platform, enabling developers to create robust and scalable web APIs for various applications.
Choosing between gRPC and WEB API will depend on your project’s goals, technical constraints, and what kind of application you’re developing. Let’s break down the difference between the two:
|gRPC||ASP.NET Core Web API|
|Complexity of Use||HTTP/2 Only, Strict specification||Any HTTP protocol, loose specification|
|Speed and Versatility||Protobuf (small, binary)||JSON/XML (large, human readable)|
|Streaming||Client, Server, Bi-directional||Client, Server|
|Compatible with React, Angular, etc…||No (not intended for use in web browsers)||Yes|
⚙ gRPC – Lean and efficient data exchange
- Utilizes HTTP/2 and Protocol Buffers, enabling highly efficient data exchange and communication between services.
- Supports bidirectional streaming, making it suitable for applications requiring real-time interactions and efficient data transfer.
- Well-suited for building polyglot systems, allowing developers to use a variety of programming languages to create interconnected services.
- Promotes a contract-first approach through Protocol Buffers, facilitating the clear definition of data structures and service interfaces in a language-agnostic manner.
- gRPC’s contract-first approach generates strongly-typed client and server code, ensuring seamless interoperability between different parts of the application.
- Recommended by MS as an alternative to CoreWCF.
⚙ ASP CORE Web API – API flexibility and versatility
- Mature framework well-suited for constructing RESTful APIs, leveraging years of development and refinement.
- Offers increased flexibility in terms of serialization formats and accommodating a variety of data interchange standards such as JSON, XML, and others. These can be chosen based on specific project requirements.
- Provides the capability to incorporate custom processing steps into API requests and responses. This allows developers to implement specialized middleware and logic tailored to their application’s needs.
- Compatible with popular frontend frameworks like React and Angular, ensuring seamless integration between the API layer and modern web applications. This is especially valuable for creating interactive and user-centric web services.
The Key Takeaways
WCF is depreciated, and it’s time to decide how to manage your WCF applications.
Your choices are:
- Migrate your application to CoreWCF
- Rewrite your application and Target ASP.NET Core Web API
- Rewrite your application and Target gRPC
Migrating to CoreWCF is far easier than rewriting your application, and is much better for large applications or ones with high client dependencies. However, gRPC and Web API can be considered as better in terms of efficiency, and definitely a better solution if you have long-term plans for the development of your application.
Making the .NET5+ Migration? Get a Copy of the .NET 8 Migration Guide
Organizations using WCF applications may be considering the migration to .NET 8. We’ve built a guide on how to successfully migrate to .NET 8 and beyond. Get your free copy today!