如何将4.5版本的WCF项目升级到.NET 6
我正在将我的 .NET 解决方案从 4.5 升级到 6.0。我在一个解决方案中有多个项目。一个具有域类的项目升级到 6.0,该项目正在使用 WCF 服务,这是另一个项目。 WCF服务项目仍处于4.5版本。我无法弄清楚,如何将 WCF 项目升级到 6.0。或者我能想到的另一种方式是,我可以从 6.0 中的模型项目调用 4.5 中的 WCF 服务吗? .NET 中是否可以向上兼容。 任何指导/替代方法都会非常有帮助。提前致谢。
I am upgrading my .NET solution from 4.5 to 6.0. I have multiple projects in one solution. One project which has domain classes is upgraded to 6.0 which is consuming WCF services which is another project. WCF service project is still in 4.5 version. I am not able to figure it out, how will I upgrade WCF project to 6.0. Or another way I could think of is, can I call WCF service which is in 4.5 from model project which is in 6.0. Is upward compatibility possible in .NET.
Any guidance/ alternate approach would be really helpful. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 WCF Web 服务引用提供程序工具添加对外部服务的引用(.NET Core 项目,包括 .NET 5 及更高版本),具体步骤请参阅以下文档。
https://learn.microsoft.com/en-us/visualstudio/data-tools/how-to-add-update-or-remove-a-wcf-data-service-reference?view=vs-2022 #添加对外部服务网络核心项目包括net-5及更高版本的引用
关于更新,您可以选择 wcf 的替代方案:gRPC、CoreWCF 和 ASP.NET Core MVC。
https://visualrecode.com/blog/wcf-alternatives-for-net5/< /a>
已经在许多跨平台应用程序和多个应用程序中使用
框架。 gRPC 将为您提供最大的灵活性。
ASP.NET Core MVC。与 gRPC 相比,它有一些缺点,但它
更易于用于 Web 应用程序。
框架不会很快消失,WCF 将继续
功能。如果尽早获得它很重要,您可以考虑
成为项目本身的贡献者。
You can add references to external services using the WCF Web Service Reference Provider tool(.NET Core projects, including .NET 5 and later), see the following documentation for specific steps.
https://learn.microsoft.com/en-us/visualstudio/data-tools/how-to-add-update-or-remove-a-wcf-data-service-reference?view=vs-2022#to-add-a-reference-to-an-external-service-net-core-projects-including-net-5-and-later
Regarding updates, you can choose alternatives to wcf: gRPC, CoreWCF, and ASP.NET Core MVC.
https://visualrecode.com/blog/wcf-alternatives-for-net5/
already used in many cross-platform applications and multiple
frameworks. gRPC will give you the most flexibility.
ASP.NET Core MVC. It has some disadvantages compared to gRPC, but it
is easier to use for web applications.
Framework isn't going away anytime soon, and WCF will continue to
function. If it's important to have it early, you might consider
becoming a contributor to the project itself.