Svcutil Configuration files are not supported.net core

4.3k Views Asked by At

I am using svcutil to get wcf service into my project.

But i get error while trying to initialize the soapClient:

ServiceSoapClient client = new ServiceSoapClient();

Here is the error:

Configuration files are not supported

I use this command to get it to my project:

svcutil myUrl.asmx /out:name.cs/config:name.config

I copied all the generated config content into my web.config file.

But without success.

3

There are 3 best solutions below

0
לבני מלכה On BEST ANSWER

For .net core i had to use dotnet svcutil and NOT just svcutil.

In cmd I use: dotnet svcutil myUrl.admx

For making it sync(as default it rendered as async) use:

dotnet svcutil myUrl.admx --sync

Now. You can wrap the rendered reference.cv with your namespace if you want.

1
Lan Huang On

WCF proxies generated by svcutil do not support loading from separate configuration files or System.Configuration.Configuration objects.

You can add a wcf service reference using the WCF Web Service Reference Provider tool.

Currently because wcf is not ported to .net core. Microsoft recommends using gRPC instead.

0
Shangwu On

If you use Visual Studio 2022, you have to download the tool.

dotnet tool install --global dotnet-svcutil

Then, run command

dotnet-svcutil <WCF-WEB-URL>