Search code examples
wcfiisdynamichostingnettcpbinding

Dynamic IIS hosted WCF Service with TCP binding


I am using Dynamic IIS Hosting (http://blog.micic.ch/net/dynamic-iis-hosted-wcf-service) with http binding. How can I use tcpbinding with dynamic IIS hosting.

Thanks


Solution

  • If you are experiencing problems with registration VirtualPathProvider on start up using non-HTTP activation, you should put class with any name to App_Code folder. This class must have public static void AppInitialize() method, where you can register VirtualPathProvider.

    namespace YourHostNameSpace.App_Code
    {
        public class NonHttpActivation
        {
            public static void AppInitialize()
            {
                 //do start up stuff here
            }
        }
    }
    

    By the way, WCF 4 provides file-less functionality out of the box on top WCF 4 Routing.