What .NET 4.0 technology provides modular fix-in-flight (hotswap) REST service hosting?

StackOverflow https://stackoverflow.com/questions/4626571

Pergunta

So, it's a dream of many years now, but hope springs eternal. Is there a framework/service (WCF/WAS/MVC/ETC) that allows you to add/update services with minimal impact on ongoing requests or "sibling" services.

The dream looks something like this:

  • IIS7

    • Pluggable REST Service Host

      • Shared resources (repositories, qa)

      • Service A - Dropped in folder in production, provides new REST methods

      • Service B - Updated "in flight" to fix a bug, minimal interruption of requests

I think the answer might involve WAS or possibly AppFabric (the dream isn't cautious) but since I've never managed to find an easy way to make it work, I welcome your input on how to best achieve what I think our PHP comrades just "do".

Foi útil?

Solução

MEF + self hosted WCF with WebHttpBinding. Or MEF with HttpListener. The new WCF Http stack at http://wcf.codeplex.com will make this much easier in the future

Outras dicas

This isn't really a REST question - it's a HTTP server question.

In the past, what I've done is to deploy a new version of an application to a new location on the server, perhaps using a URL only visible internally. I then have simply switched the IIS properties to point to the new URL.

This is a strange question. First we are in .NET world where assemblies are compiled - this has big impact on other things.

So basically yes you can do what you want if you start programming like PHP programmers. Open your .svc file and write whole your service directly to this file. This is also known as inline coding. You will be able to use types from assemblies deployed to GAC and Bin folder of your site. Just copying the .svc file to your web application directory will make your service available. Modification will also be easy. You have to use .NET 4.0 and you will not need any configuration change when "deploying" new service.

Edit:

Based on comments I'm adding some futher explanation.

IIS and anything dependent on IIS (WAS, AppFabric) always recycle the domain when new assembly is added. I think the reason is directly in .NET core - AppDomain. Loading and unloading assemblies dynamically requires new domain.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top