0

Trying to add WCF RIA Services class library to my SL5 app in VS 2010 but once I set the WCF RIA Services Link in class library properties, project fails to build with numerous "The type or namespace name 'QueryResult' could not be found", 'EntitySet', EntityQuery' errors...

I'm following the MSDN Walkthrough Walkthrough: Creating a RIA Services Class Library trying to port a subset of my WPF app to SL5 so I first created an SL5 application with RIA checkbox uncheked which created two projects:

  • MySLApp (Silverlight 5)
  • MySLApp.Web (.NET 4)

Once I had that in place I added WCF RIA Services class library which created another two projects:

  • MySLAppWCF (Silverlight 5)
  • MySLAppWCF.Web (.NET 4)

In MySLAppWCF.Web I created an ADO .NET Entity Data Model and added a Domain Service Class using an entity from the Data Model. At this point all these new projects buid fine so I added a reference to MySLAppWCF in my MySLApp project and a reference to MySLAppWCF.Web in my MySLApp.Web but the final step to get all this wired up is to set the WCF RIA Services Link in MySLAppWCF to MySLAppWCF.Web but once I do that it all blows up with numerous "The type or namespace couldn not be found" errors. I checked the references in the library and there is a reference to System.ServiceModel there.

Any ideas on how to get all this working?

EDIT: I kept digging and found something about adding a reference to System.ServiceModel.DomainServices.Client library which is located in RIA SDK so I did that and it took care of the original errors but now I'm getting WebDomainClient and DomainServiceFault not found in my MySLAppWCF project even after adding a reference to System.ServiceModel.DomainServices.Client there as well and these two appear to be in that namespace...

4

1 に答える 1

1

WebDomainClientとの両方DomainServiceFaultが System.ServiceModel.DomainServices.Client.Web で定義されています (通常は C:\Program Files (x86)\Microsoft SDKs\RIA Services\v1.0\Libraries\Silverlight\System.ServiceModel.DomainServices.Client.Web にあります) .dll)
このアセンブリへの参照も追加する必要があります。

2 つの異なるサイト (SL アプリケーションをホストするサイトと domainServices をホストするサイト) がある場合、設計によっていくつかの問題が発生する可能性があることを断言させてください。 MySLAppWCF.Web を通常の DLL に変換し、ホストから参照することをお勧めします。

また、MySLAppWCF.Web の web.config に注意してください。VS は、必要な DomainServiceModule を使用するためにそれを変更しました。

于 2012-11-15T20:37:26.783 に答える