Friday, 18 March 2011

Can’t debug client side code of Silverlight Application in local host

One of my colleague bought this to my attention. He had this project that he build, it has both client and server side piece. It was all working fine and he was asked to fix something in the existing project for new release. He got the version from source safe and try to debug the code, to his surprise he was able to debug only the server side code (RIA services) but none of the client side break point is working.

I jumped in the issue. I got a different version which I was able to debug both client and server side, so I asked him to compare both projects and see what is it different. It turned out, in the  web project properties, under ‘web’ tab all way at the bottom, there is a group called ‘Debuggers’, make sure you have Silverlight check box is checked. In his project, it was not checked that’s why he couldn’t debug. By checking the Silverlight check box now he is able to debug the client side code just fine.

image

Tuesday, 15 March 2011

Can you make dll disappear in Visual Studio?

This is more of note to myself so that I do not forget. I ran into a problem today. I am creating a simple console app, which is going to consume a dll my colleague wrote. Both are developed using VS 2010. One was developed using C# and another one developed using VB. C# main app targets 4.0 frame work, while the VB one targets 3.5 framework. References are added and started my first line of code.

VBNameSpace.VBClient client = new VBNameSpace.VBClient();

When I was writing, everything was good, Right after the namespace, VS promptly helped me with intellisense thus I know, dll is understood. I wrote just that first line and compiled the code and there it is, compilation failed with errors. The error message pertains to VBNameSpace that, it does not know where to get it from. I thought, it may be that I missed something, so I deleted the reference and added the reference again and now in the VS studio all turned blue so I know VS understood the dll. I thought it might be my mistake, I might have been seen something. Anyway, compiled again, boom the error is back. I tried various things but nothing work.

Finally Google the issue , In stack over flow got the answer. My mistake was in the project profile, my target framework was .Net Framework 4 client profile, that need to be changed to .Net Frame 4 (note, no ‘client profile’). With that change, it compiles and runs fine.

Thursday, 10 March 2011

Exposing RIA services

So far all the projects I have done, the client consumes the RIA services in the same project and the whole world is simple and so happy till, I had to expose one the current project service out for other project to consume. My friend Travis and I are worked on this problem. After some Google, got the following link on silverlight show. But before you go on to do the 10 steps to expose your RIA web services you make sure you get latest version of RIA services and Toolkit from Silverlight.Net.