Solution can't find SilverlightApplication.Web namespace

    General discussion

  • Hi,

     I've been following the example in the overview document and I'm running into a problem concerning the use of the SilverlightApplication1.Web namespace.  In the code-behind of MainPage.xaml.cs, it can't resolve the symbol 'Web' in the statement 'using SilverlightApplication1.Web'.  I've created the server link during project generation as instructed, and there is generated code for the proxy class in the client with the namespace of SilverlightApplication1.Web 



    Friday, March 20, 2009 4:33 PM

All replies

  • I'm having the same problem, i guess the Sl client isn't linked to the Web or something like that..
    Monday, March 23, 2009 5:22 AM
  • You cannot use the Webproject's assembly directly from your Silverlight Application. In order to communicate with the Web project from Silverlight you'll have to add WCF Service (or similar) to the Web project and add a Service Reference to this WCF Service from your Silverlight application.
    Monday, March 23, 2009 7:29 AM
  • I followed the RIA MIX Walkthrough ( and it works now..
    Monday, March 23, 2009 7:45 AM
  • For the record, one of the core value props for RIA Services is that you *don't* have to add service endpoints.  That's part of the plumbing that RIA Services handles.

    When you create Silverlight application and check the "Link to ASP.NET server project" option, it injects a property (<LinkedServerProject />) into the client project, and whenever you build either the solution or the client project, it will trigger a code-gen pass.  If you have any DomainService marked with [EnableClientAccess] in the Web App project, proxy classes will be generated into the client project.

    These classes will have the same namespace as the DomainService -- meaning the statement "using SilverlightApplication1.Web" on the client should resolve to the generated proxy classes.

    If you ever get into this mode again, turn on "Show All Files" in the client project and peek at the Generated Code folder.  It will have your proxy classes.  If they don't show up, it likely means that you don't have a DomainService in the Web project that is marked with [EnableClientAccess].

     Ron Cain [MSFT]

    Monday, March 23, 2009 10:48 AM