dotnet / wcf

This repo contains the client-oriented WCF libraries that enable applications built on .NET Core to communicate with WCF services.
MIT License
1.7k stars 560 forks source link

F#, VB support in WCF Web Service Reference Provider Tool? #4381

Open CharlesMonk opened 3 years ago

CharlesMonk commented 3 years ago

Have I missed some setting?

In the latest VS2019, I tried using the WCF Web Service Reference Provider Tool in a C# Net.Core project and it was as advertised.

No such option was available in VB.net and F# projects. Do we need to stick with the full Windows .NET Framework if we are using those languages for WCF client code?

Screenshot: Happy-Sad-Sad

mconnew commented 3 years ago

I love the graphics!! The WCF Connected Services tools as you have discovered only supports generating of C# code which is why it's not available for projects targeting other languages. There are two possible solutions for you, the hard one and the easy one. The hard one is to contribute the code to the dotnet-svcutil utility that the connected services tool is based on (it's in this repo now) to support those other languages. If on the other hand you can't spare several months of your life to this noble cause, you could generate your WCF client into a library project of it's own and then reference that project from your F# or VB applications. The generated C# client code will happily compile to a .NET assembly which can be referenced from any other .NET language. I know that's not ideal, but it's a let easier than spending several months of your life adding the support to dotnet-svcutil.

CharlesMonk commented 3 years ago

Hi,

Thanks for the clarifying comment.

I see now that by following a link on the tool dialog to https://docs.microsoft.com/en-us/dotnet/core/additional-tools/wcf-web-service-reference-guide, the documentation clearly states that it's C# only. Sorry that I missed that and redundantly posted here to get the same information.

Making a wrapper DLL is a very easy practical workaround, and looks like it will work fine. Hacking around for months in the code for SvcUtil would enable import to VB.NET or F# projects. If I understand correctly, there is a third option, which would be to transpile the generated Reference.cs file into VB or F#.

But the simplest thing is just to stick with the original .NET Framework. Sadly, this seems to be the answer whenever I take a serious look at .NET Core technologies.

I'm afraid that you're right - I don't have months to spend looking at the code inside SvcUtil. I'm a Visual Studio customer who is using the software to get my own work done. It's an old-fashioned world view, I suppose, but I'm happy to pay for tool builders to make tools which I can then just use.

CM.

teunlielu commented 3 years ago

Is there a schedule for adding these languages ​​or not? I sincerely hope so. This is very difficult.

CharlesMonk commented 3 years ago

As far as I can tell, there is currently no reason to expect that support for other languages will be added. All trends point in the opposite direction.

Matt's suggestion about making a wrapper DLL around the WCF client is really not so difficult, I think.

teunlielu commented 3 years ago

You can now still convert .net project to .net core project but or will work properly after .net 5