locked
Hosting RIA Services using WCF Service Host? RRS feed

  • Question

  • Just wondering if my RIA Services can be hosted using the WCF ServiceHost bundled with VS 2012 ?   I tried to run it passing two parameters

    1) /service:<The DLL of the project that has the DomainService>

    2) /config:< the web.config file that is normally found in the Web Project hosting the RIA Services

    I get the following error " The target assembly contains no service types.  You may need to adjust the Code Access Security policy of this Assembly"?

    Thursday, March 7, 2013 1:46 PM

Answers

  • One of the things you can configure on a WCF service is AspNetCompatibilityRequirementsMode. There are three settings, NotAllowed, Allowed, and Required. The DomainService is configured as Required.

    Being in ASP.NET compatibility mode makes the DomainService part of the overall web application so it can access the session state and get the group memberships of the currently logged in user. Since the security model is so integral to how the DomainService functions, the RIA Services team decided to just require ASP.NET compatibility instead of trying to support Allowed instead of Required.


    http://www.riaservicesblog.net | RIA Services and MVVM http://bit.ly/pgL97k


    • Edited by Colin Blair Thursday, March 7, 2013 5:21 PM
    • Marked as answer by DoWorkAync Thursday, March 7, 2013 6:19 PM
    Thursday, March 7, 2013 5:21 PM

All replies

  • No, the DomainService requires ASP.NET compatiblity mode so it can't be self hosted or use the WCF ServiceHost.


    http://www.riaservicesblog.net | RIA Services and MVVM http://bit.ly/pgL97k

    Thursday, March 7, 2013 1:56 PM
  • Hmm...I had (naively) assumed RIA Services is just essentially WCF Services .. but I guess there is more to it... and from what you say there is a dependency on ASP.Net which WCF (plain) does not have?

    Thursday, March 7, 2013 2:17 PM
  • One of the things you can configure on a WCF service is AspNetCompatibilityRequirementsMode. There are three settings, NotAllowed, Allowed, and Required. The DomainService is configured as Required.

    Being in ASP.NET compatibility mode makes the DomainService part of the overall web application so it can access the session state and get the group memberships of the currently logged in user. Since the security model is so integral to how the DomainService functions, the RIA Services team decided to just require ASP.NET compatibility instead of trying to support Allowed instead of Required.


    http://www.riaservicesblog.net | RIA Services and MVVM http://bit.ly/pgL97k


    • Edited by Colin Blair Thursday, March 7, 2013 5:21 PM
    • Marked as answer by DoWorkAync Thursday, March 7, 2013 6:19 PM
    Thursday, March 7, 2013 5:21 PM
  • Thanks so much for your clarification... you really know this technology :-)

    Thursday, March 7, 2013 6:18 PM