SoapCore 错误

Top*_*000 1 c# .net-core asp.net-core soapcore

当我尝试访问我在 .Net Core 3.0 中创建的服务的 wsdl 页面时,我不断遇到此问题。请求到达管道末端,但未执行端点:“SoapCore”。如果使用路由,请使用“IApplicationBuilder.UseEndpoints(...)”注册 EndpointMiddleware。

SoapCore 版本:1.1.0.1-beta 我也尝试过版本 1.0.0,结果相同

代码:配置服务功能

    services.AddControllers();
    services.AddSoapCore();
    services.TryAddSingleton<MyService>();
    services.AddMvc();
Run Code Online (Sandbox Code Playgroud)

配置功能

    if (env.IsDevelopment() || env.IsEnvironment("local"))
    {
        app.UseDeveloperExceptionPage();
    }
    else
    {
        app.UseHsts();
    }

    app.UseHttpsRedirection();
   
    app.UseRouting();
    app.UseAuthorization();            

    app.UseEndpoints(endpoints =>
    {
        endpoints.UseSoapEndpoint<MyService>("/Service.svc", new BasicHttpBinding(), SoapSerializer.DataContractSerializer);
        endpoints.MapControllers();
    });
Run Code Online (Sandbox Code Playgroud)

Top*_*000 8

看来路径是区分大小写的。抱歉,如果有人像我一样冷漠,请确保在访问您的路线时将其大小写与代码中的大小写相同。