1

I have a blazor project in .NET 6.0

I need to call a SOAP WebService (guide here)

What I do is to import WSDL as Connected Service in another project of my solution with target framework NET4.8

The solution builds correctly, but when I debug and I try to call the method from blazor app I have the following error

System.IO.FileNotFoundException HResult=0x80070002 Message=Could not load file or assembly 'System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context

Now, I suppose it's a .NET version compatibility problem, but how I can solve it?

EDIT

I try creating a new project .NET 6.0 and adding Connected service. Calling the method from my blazor (.NET 6.0) project and I have the same error. Probably the web service use something that is incompatible?

Thanks in advance

Martina
  • 1,852
  • 8
  • 41
  • 78

1 Answers1

-1

Try to add a reference to the NuGet Package System.Windows.Compatibility

Marvin Klein
  • 1,436
  • 10
  • 33