CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2011
    Posts
    3

    WCF Services and run-time management

    Hello
    I'm new here at CodeGuru.com. And I'm starting with a thread about WCF-services.

    I have experience with WCF hosted in IIS and self-hosted in a Windows Service.
    But I have experienced a new sort of demand which I cannot seem to find any good solution to.

    When I host my WCF services in a Win Service app, I have possibility to load external DLLs (assemblies), look for classes which implements an interface or class that I have created, and then load the content as WCF services by using the ServiceHost class.

    My host application does therefore not have to have a reference to those DLL-files. So they can be DLLs that I create specifig for customers that has other needs, etc etc. Like "plug-ins".

    But...
    I now have to host my WCF services in IIS.
    This means that all the configuration in the Web.Config file.
    I have one WCF service that is always started. This one has config for service, endpoints and behaviors in the web.config file.

    If I haven't misunderstood too much, in order to add my services as <service> tags in my web.config file, I have to have reference to the DLL that contains the .SVC-file and other functional code.

    I don't wanna have references to the "plug-in" DLLs. Because (as explained) this may be generic DLLs that follow interfaces of base classes that I have created.

    My question :
    IS it possible to still use the ServiceHost to start more WCF-services, but still use the endpoints and behaviors that I have set up in the web.config file?

    I don't know if I have managed to explain my "scenario" completely.
    So feel free to ask foro information in order to help me in my quest :-)

    *cheers*

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: WCF Services and run-time management

    Unfortunately, I don't have an answer for you. I generally have always hosted WCF services via a Windows Service.

    Out of curiousity, why are you forced to hosting the WCF services in IIS? IIS hosting WCF is less secure and has fewer hosting options over Window Services or WAS.

  3. #3
    Join Date
    Apr 2011
    Posts
    3

    Re: WCF Services and run-time management

    Hi
    Yeah, I also usually host my services in a Windows Service because of the reasons you have :-)

    But this is unfortunately a customer related demand, that they want it hosted in IIS.
    First of all, that's their environment. And I think they would ilke to create Silverlight-apps to the service some time in the future, and then IIS is less hazzle because of the "cross-domain" xml stuff and such.

    And...I also believe they would like an easier port the solutino to some Cloud solution in the future. And that way is easier from IIS than from a self-hosted app (they say).

    I couldn't find any good arguments that my usual Windows Service self-hosting would be bullet proof in those two scenarios. So they said that IIS is the way to host.

    I'll look more into it.
    I hope someone out there may have some suggestions :-)

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: WCF Services and run-time management

    Like I said, I don't have too much experience in this area.

    One thing I might suggest is to create a the IIS hosted WCF service project.

    Note: the difference between Visual C#\Web\WCF Service application project and a Visual C#\WCF\WCF Service application project.

    (the former is the IIS hosted WCF project)

    Maybe creating one of each will give you some ideas?

  5. #5
    Join Date
    Apr 2011
    Posts
    3

    Re: WCF Services and run-time management

    I tried to create a "WCF Service Application" project. That allowed me to create a WCF application that is hosted in IIS. That is also the project that has the "Web.Config"-file that contains the endpoint, behavior and service configuration of the services I have.

    So far, so good. I can create any service I like and add it here.
    But this means that all the services that I would like to start must be in my "WCF Server Application" project, or a project that is referenced to. Then I can add services in the web.config file.

    But my need is that I would like the "WCF Service Application" to not have references to the services I'd like to start. Because these are customer-specific and plugin-related services that the main project may not know about. I use late binding and "Assembly.Load()" to get classes from these assemblies.

    But I guess this is a restriction in IIS.
    It works fine when I self-host my services.

    Blah...Well... Thanks for any ideas :-) Anything is something!
    I appreciate the replies :-)

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: WCF Services and run-time management

    Quote Originally Posted by theHollow View Post
    But my need is that I would like the "WCF Service Application" to not have references to the services I'd like to start. Because these are customer-specific and plugin-related services that the main project may not know about.
    You were clear from your first post what you were looking for - unfortunately I don't have the answer.

    Perhaps you can convince your client to host with a Windows Service?

    Btw, I've written an article series on using WCF to communicate between a Windows Service and a Tray Icon application.

    I dynamically load WCF services from a Window Service. You might find my approach interesting (or not <g>).

    Tray Notify - Part I

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured