Visual studio 2010 comes with nice Silverlight designer, But for LOB applications you always need data which can be pumped only via WCF RIA service (assuming you want to finish the project ASAP). Lot of programmers have still issues with WCF RIA 1.0 (for Vs2010) in terms of publishing the application on shared hosting domain. Actually this problem is because of not having correct version of .net framework on shared hosting domains. Example – my hosting provider has .net version 4.0.2xxx installed on web server. With 4.0.2 i got error saying Unrecognized attribute ‘multipleSiteBindingsEnabled’ where as on local machine i am having 4.0.3, and hosting provider will not install .net version on shared hosting domain until it get stable and they get some confidence ..So till than are we going to use Silverlight 3 ??
Well in my previous post i have tried to fix issues with WCF RIA on shared hosting domain which is working fine. Note that this fix is for WCF RIA Beta 1 which is compiled for Vs 2008. There is no fix available which could be applied to WCF RIA 1.0 (for 2010) in similar way. What we are going to do here is use best out of what we have i.e SL 4.0 + Vs2010 and WCF RIA + Vs2008.
Jumping directly to the point : How to work with Silverlight 4.0 (VS 2010) and WCF RIA (VS 2008)..
What you required:
- Vs 2008 with WCF RIA Beta
- Vs 2010 with Silverlight 4.0
How to build:
- Create WCF RIA Service Library using Visual Studio 2008. –
- Above step will create two libraries -one for silverlight project (client) and another for web server project.
- Create another Silverlight business app using Visual Studio 2008
- Add above assemblies to both projects (Sl+Web).- test it.
- Now delete the SL project created in step 2. we will only need wcf-web project from step 2.
- Now Open Vs 2010 and open the web project (existing) created in step 2 above.This will migrate you project from VS 2008 to 2010.
- Add new silverlight project to above solution.
- Go to properties of web project and link it with silverlight project in the group.
And that it !
For silverlight application you will use VS 2010 (framework 3.5) and for Ria service you need to launch Vs 2008 (project in step 1).
While you try to publish app on shared hosting domain,the fix which is provided in my previous articles can be applied. The WCF RIA libraries generated in step 1 could be migrated to WCF RIA 1.0 if in future issues with WCF got resolved and you need not to change you silverlight app.
I still need to test the solution mentioned above (althought i had quick test before writting this article) to ensure that we are not lossing any thing..
Let me know if template project is required for this, i will be glad to help..
So what you are thinking now go-ahead….
You may need to refer fix2 to catch exceptions from server..