1
votes

I wasn't sure how to title this question. I'm creating an RIA Services driven Silverlight 4 application.

I started out with a Silverlight Navigation Application. I'd like to be able to add a namespace from the server side project in my solution into a XAML file in the client project of the solution.

When you create a Silverlight Business Application, the 'connection' is made between the two projects when the solution is created that will allow you to do what I explained in the previous paragraph.

Is there a way to modify my Silverlight Navigation Application so that I can add a namespace from the server side project in my solution into a XAML file in the client project?

2
I think what I may have done is neglect to check the “Enable WCF RIA Services” checkbox when I first created the solution. Could this be causing the trouble? If so how can I “Enable WCF RIA Services” now that I've already created my solution? - Brent Lamborn

2 Answers

0
votes

Why do you want to add a server side namespace to your client side project? Do you want to be able to use a type defined in the server project in your client project?

If so, the easiest way to do this is to add ".shared" to the name of the file in question in the server project. Like "MyCoolType.shared.cs", when RIA services sees that ".shared", it will copy that type over to the client project during its code generation.

You really end up with two different types, one defined in the server project and one defined in the client project, but from your perspective it feels like one type.

0
votes

The solution is to set the WCF RIA Services link in the client side project's properties (Silverlight tab) to the server side project.