简体   繁体   中英

UseSoapEndpoint is not working after migrating to .Net 6.0 from .NET core 3.1

Initially it was working but I have tried to migrating .NET core 3.1 to .NET 6.0, then I'm getting this error 'IEndpointRouterBuilder' does not contain a definition for 'UseSoapEndpoint'

app.UseEndpoints(endpoints => {
        endpoints.UseSoapEndpoint<SapMdusServerImplementation>("/ServicePath.asmx", new SoapEncoderOptions(), SoapSerializer.DataContractSerializer);
});

Is there a reference to SoapCore in your Program.cs file: using SoapCore; ?

After testing,I found that the problem you mentioned can occur in two cases:

One is the lack of a reference to SoapCore;

The other is to define the endpoint in a different way:

app.UseEndpoints(endpoints => {
    endpoints.UseSoapEndpoint<ISampleService>("/Service.asmx", new BasicHttpBinding(), SoapSerializer.XmlSerializer);
});

I have the same problem you have when I use new BasicHttpBinding() .This seems to depend on the environment and configuration.

If you are referencing SoapCore, I suggest you try the second approach.If the problem persists, I suggest you create an empty .net 6 project and add this line of code to see if the problem persists.Maybe you can do a better job of troubleshooting.

I hope it helps.Good luck.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM