Wcf: Not able to generate methods that could be called synchronously.

Created on 23 Dec 2015  路  12Comments  路  Source: dotnet/wcf

When adding the WCF service reference there is no way to set how the methods should be called. And it always generates methods that could only be called asynchronously.

feature request tooling

Most helpful comment

dotnet-svcutil 2.0.1 is now available with the --sync option.

All 12 comments

cc: @mlacouture

Hi @gauravmahto

Just to give you an update on this issue, we have decided not to provide a solution for it at this point as there are other features that block customer scenarios that for most are higher priority work. We will keep your request for a future review. Let us know if you need any assistance from us for this issue.

We also encourage people reading this thread to add your reaction (by clicking the happy face above) to this issue.

thank you again for helping us improve the WCF Web Service Reference connected service provider tool,

Miguel Lacouture

this is a feature that is not feasible as we need to follow async programming best practices, check out this article in the MSDN for reference.
We will be improving the docs to provide examples about how to use the generated code, please use issue #2947 for tracking. thank you!

I reopened this issue because we've had multiple customers asking for this in a few different issues. There are a few reasons why this is not currently supported. Problems with mixing sync and async calls being one, and the history of how async was handled in earlier versions of .NET Core when this tool was originally planned.

Because of the amount of people wanting this we want to take another look at this to see if we can add this as an option for the tool.

+1

Currently I am generating the client using full framework and manually changing a few lines to make it build and work in .net standard.

+1

Hi Microsoft members,

If you are going to "not support" the sync method, it will generate a lot of work the developers need to do themselves. This will make the time estimated for migrating to .net core almost the same as we migrate it to a different platform, say Java. As a CSharp lover, I am quite disappointed that when the decision of removing the support of the sync method was made, it was not considering the effort we try to keep our bose to be confident at keeping using CSharp.

Turn that on with an Obsolete attribute will be welcome.

Thanks,
Frank

We have added an option to generate synchronous operations to the WCF Web Service Reference starting in Visual Studio 2019 v16.1 Preview 3. It's a checkbox on the Client Options page of the wizard.

For now this is only available in the UI tool, but we are planning to make this available in dotnet-svcutil as a command line parameter (--sync) in the next version we release (2.0.1).

I have released version 16.0.3 which seems to be the latest and I don't see checkbox there. Can you please clarify if it is supposed to be there or anything changed in your plans?

@yshteinm 16.1 is still in preview, so you will need to either way until it goes to the release channel (which is scheduled for later this month) or install the preview version of VS from https://visualstudio.microsoft.com/vs/preview/.

Is it possible to get dotnet-svcutil 2.0.1 with --sync flag support? Seems there is no package available on nuget yet.

@stukselbax We're still working on dotnet-svcutil 2.0.1 so it's not available for download yet. I'll update this thread when we release it.

dotnet-svcutil 2.0.1 is now available with the --sync option.

Was this page helpful?
0 / 5 - 0 ratings