'.NET 6 how to add webservice reference

How can I add reference to SOAP web service (.asmx) in .NET 6.

In .NET Framework there is Web references in VS with autogenerated proxy classes. How to can I migrate .NET Framework project with web references to .NET 6 ?



Solution 1:[1]

Looking at your actual error,

The Connected Services component 'Microsoft WCF Web Service Reference Provider' failed: The project reference specification 'System.Web.Services' does not have a file path.

maybe you are hitting the same issue as stated here: https://github.com/dotnet/wcf/issues/4713 ?

Their fix seems to be:

Remove this,

<ItemGroup>
    <Reference Include="System.ServiceModel">
      <Private>false</Private>
    </Reference>    
</ItemGroup>

but the other comment might also be important:

Update: fix of the issue would be available in the upcoming Visual Studio 2022 release.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mladen Mihajlovic