Purnima Naik
Purnima Naik

Reputation: 2683

Make existing WCF service to run on Linux using .net core

I am totally new to .net core.

My task is to run WCF services on Linux. My WCF service is built with .NET Framework 4. I host my services in IIS.

Can you please provide me with proper direction, to deal with below problems,

  1. What changes I need to do to my current WCF service, to run it on Linux?

  2. What OS version of Linux I need, to make it to work with .net core?

  3. Currently, I host my service in IIS, how can I host that in Linux, because we have about 40 services.

    What I have found on Internet, is hosting WCF service in console application, is there a better way of hosting, as I have more than 40 services.

Upvotes: 2

Views: 3269

Answers (2)

Idan Matityahu
Idan Matityahu

Reputation: 39

I guess it is not exactly what you are looking for but you might find it useful.
dotnetcorersi is a TCP based solution for remote service invocation in dotnet core framework.

Host your service

    // Initialize new instance of RemoteServiceContainer
    var container = new RemoteServiceContainer();

    // Register MyCustomService as IMyCustomService 
    container.RegisterService(typeof(IMyCustomService), new MyCustomService());

    // Open connection 
    container.Open(serverIp, port);

Initialize service proxy in client side

    // Create instance of ServiceChannel
    var servicesChannel = new ServiceChannel(serverIp, port);

    // Generate remote service proxy
    var proxy = servicesChannel.GetRemoteService<IMyCustomService>();

Use your service

    // Do some work in the server context
    proxy.DoSomething();

Upvotes: 1

svick
svick

Reputation: 244998

.Net Core 1.0 does not support writing WCF servers, only clients that connect to them. The README of the WCF repository says:

WCF service applications should still be created with the full .NET Framework version.

Microsoft is considering adding support for WCF servers in the future, but nothing is certain right now. From a post on the WCF repository from 16 July 2016:

We have reviewed all the great responses above in regards to WCF Server support in .NET Core.

The WCF feature team is actively working on roadmap plans for WCF functionality in future .NET Core releases. For next steps, we need your feedback in terms of top scenarios, feature usage and target profiles.

It then links to a survey.

Upvotes: 4

Related Questions