CoreWCF icon indicating copy to clipboard operation
CoreWCF copied to clipboard

[Bug]: Using a Generic Host doesn't work when using a transport that implements ITransportServiceBuilder

Open mconnew opened this issue 2 years ago • 1 comments

Duplicate ?

  • [X] I have searched issues/discussions and did not find other issues/discussions reporting this bug.

Product version

1.5.1

Describe expected behavior

Using var builder = new HostBuilder(); to create a Generic Host should be able to be used for hosting a Queue based service which has no need for Kestrel.

Describe actual behavior

An exception is thrown because of the code here or here.

Which binding

CustomBinding

security

None

Which .NET version

.NET 7

Which os platform

Windows

Code snippet used to reproduce the issue

No response

Stacktrace if any

Message: 
System.InvalidOperationException : WebHost required for the CoreWCF service configuration. Use IApplicationBuilder.UseServiceModel instead.

  Stack Trace: 
ServiceModelApplicationBuilderExtensions.UseServiceModel(IServiceProvider serviceProvider)
ServiceModelApplicationBuilderExtensions.UseServiceModel(IServiceProvider serviceProvider, Action`1 configureServices)
ServiceModelApplicationBuilderExtensions.UseServiceModel(IHost host, Action`1 configureServices)

mconnew avatar Feb 17 '24 01:02 mconnew

trying migrate CoreWCF Template to use Host.CreateApplicationBuilder instead of deprecated Microsoft.AspNetCore package, getting the following error:

System.InvalidOperationException: 'WebHost required for the CoreWCF service configuration. Use IApplicationBuilder.UseServiceModel instead.'

Any workarounds?

kachalkov avatar Dec 09 '24 05:12 kachalkov