WCF Named Pipes in a WPF Application

How would you start a WCF service named pipe against the background of a Windows WPF application? I can't seem to find WCF server startup patterns in a WPF application.

Any ideas?

I am currently using the following code in Application_Startup. Do I need to run my own thread with it?

    Using Host As ServiceModel.ServiceHost = New ServiceModel.ServiceHost(GetType(Service), New Uri(("net.pipe://localhost")))
        '
        Host.AddServiceEndpoint(GetType(IService), New ServiceModel.NetNamedPipeBinding, "Test")
        Host.Open()
        '
    End Using
+3
source share
2 answers

I removed the Code Usage block and set ServiceHost as a private variable in the WPF application class. Then I close ServiceHost when the application shuts down. This seems to be normal.

0
source

Juval Lowy ServiceModelEx, , WCF , , , WCF, , , , WPF.

InProcFactory, 60 "" WCF- " Juval Lowy. , ," " WCF.

, , .

+2

Source: https://habr.com/ru/post/1710967/


All Articles