Archive for March, 2008

agTweener 2.0 is out

March 24, 2008

Just noticed that Michael Cameron just released a new agTweener version 2.0 that is compatible with Silverlight 2 Beta 1. This is a great solution for leveraging animations in Silverlight. The best of all, it’s in CodePlex.

For more information and samples go to Michael’s blog

AN.

Calling SharePoint Web Service from Silverlight 2

March 18, 2008

I was testing a simple Silverlight 2 application exposed in a web part to get information from an existing SharePoint Web Service.

Initially what I’ve tried was to reference the SharePoint Web Service in my Silverlight application. When I tried to compile I got an error message saying the XmlElement was not implemented yet in this Silverlight version. So basically, looking at the documentation there are some limitations to call SOAP services in Silverlight (see Accessing SOAP Services

So what I’ve tried was to change the XmlElement to Object, but unfortunately looks like the deserialization doesn’t work since the result is returned as null.

In the end I’ve created a custom proxy asmx service and placed it inside my ISAPI folder on the 12 hive so I could access it from my application with something like http://myserver/_vti_bin/mycustomservice.asmx. But I was still having problems. I was getting a ProtocolException. After some investigation it was clear I was missing the crossdomain.xml or clientaccesspolicy.xml file in the root folder of my site (see How to: Make a Service Available Across Domain Boundaries).

That was easy, I’ve created a simple clientaccesspolicy.xml file and placed it on the root folder of my SharePoint site under the Inetpub\wss\virtualdirectories\[site port] folder. Then I tried again and, what ?!? How come ?!? It was still not working. After some astonishment and bafflement, I did some HTTP debugging and saw that the call to retrieve the clientaccesspolicy.xml file was returning an error 404. But I knew the file was there in the root folder, I even tried to browse it from IIS, but got the same error. Then it just came to my mind (as obvious it could be) that SharePoint uses virtual sites stored in the content database so I opened SharePoint designer and copied the file to the site, and bingo ! I could call the service and it was working fine this time.

Well, hope that helps and save you some time trying to figure it out.

Also, just as a last tip, found this blog that is from the Silverlight Web Services team. Some good info there (Silverlight Web Services Team)

Well I guess that in order to use the existing SharePoint Web Services directly from Silverlight 2 is not possible at this time. Please let me know if you can successfully make this work.

AN.

IE Crashing with Silverlight 2 - Fixed it !

March 14, 2008

In my previous post (SharePoint + Silverlight Blueprints configuration instructions), I mentioned that I was experiencing some crashes in IE7 while viewing some Silverlight 2 content. I did some troubleshooting and finally the problem seems to be fixed for now (knock on wood).

So in order to troubleshoot it, I’ve used a HTTP debugger called Fiddler (a must have if you are doing web development). One thing that I’ve noticed in my HTTP requests was a call to a go.microsoft.com site (see below). If I refreshed the browser while this HTTP request was still in progress the browser would crash with an Unhandled Exception on npctrl.dll.

This is the output I’ve got on the HTTP request which returned a HTTP 502 status code (more on that later).

This is what Fiddler was showing…

20 502 HTTP go.microsoft.com /fwlink/?prd=12063&plcid=0×409&ar=UPDATE&sar=AUTO&pver=2.0.30226.2&os=19 512  text/html  

But wait, I forgot to mention that I was testing this from a VPC (Virtual Machine). One thing that came to my mind right away was that my VPC didn’t have the network card enabled (so I was not connected to the Internet on it). That’s why I think I’ve got 502’s (Bad Gateway). So I’ve tried to enable the network and after I’ve got Internet connection on my VPC the code changed to HTTP status code 302 (Redirection/Found). But I was still experiencing some crashes.

At this point in time my suspicion was more related to the plugin installation since it was crashing on the npctrl.dll, which seems to a wrapper for agcore.dll to run in Firefox (see Dissecting Silverlight). The npctrl.dll is installed on C:\Program Files\Microsoft Silverlight\2.0.30226.2 in Windows, and just to make sure I had the same version on my VPC and on my PC I’ve double checked this folder and it seemed to be right.

Then, I did some HTTP debugging on my own machine (not the VPC) with some Silverlight 2 Beta 1 Samples and some other SL2 samples already on the web and for my surprise the HTTP request to go.microsoft.com was not even showing up. So this made my suspicion on the plugin to grew stronger.

One thing that I forgot to do at this point was to also test these Samples on my VPC. Once I did that I was surprised to see that when I’ve tried to get to these sites, the install Silverlight 2 banner showed up which was strange because I know that it was already installed (so far I was testing only locally, with some local VS2008 project sites and using a local SharePoint site to expose Silverlight content and that didn’t prompt me to install Silverlight 2).

Then I decided to click on the install Silverlight 2 banner from one of the sample sites to have it installed again on my VPC. Once the plugin was installed, I’ve restarted the browser and did some more testing and debbuging. 

Surprise ! No more crashes ! I couldn’t see the HTTP request to go.microsoft.com again and everything seems to be ok now.

So, to make a long story short. Here are a few things to double check if you are experiencing some crashes:

  • If you had Silverlight 1.1 installed make sure you uninstall it before installing Silverlight 2 Beta 1 plugin
  • If you are doing Silverlight development and are installing all Silverlight components such as VS2008 tools and SDK, make sure you uninstall all Silverlight 1.1 components.
  • I didn’t experience these crashes using Firefox, only in IE.
  • If you already have Silverlight 2 installed and IE is crashing, try to uninstall/install again.
  • If you are using IE, make sure ActiveX components are allowed for that zone (Tools -> Internet Options -> Security). Some companies do not allow ActiveX components to run specially on Internet zones (this may be set via Group Policies).

Well I hope this can help you do some troubleshooting and fix this problem if you are experiencing it too.

Not sure exactly why this was happening, if it was something related to the npctrl.dll installation, or even the Mime type configured for the plugin.

All I know is that it’s working now and I’m happy !

SharePoint + Silverlight Blueprints configuration instructions

March 12, 2008

I’ve been looking for this for a while. You can find the instructions (with video) on Patrick Tisseghem’s blog.

http://www.u2u.info/Blogs/Patrick/Lists/Categories/Category.aspx?Name=Silverlight%20BluePrint

After following all the steps, I still needed to recompile all .xap files using VS2008. Only after I recompiled the files and copied to the ClienBin folder that I could see Silverlight content on SharePoint.

I’ve also experienced my IE7 crashing several times. Not sure why this is happening. I’ve already tried to reinstall the SL2 plugin and it still crashes (unhandled exception on npctrl.dll). But so far I’ve noticed it crashing only on my MOSS site, running from VS2008 Silverlight projects seems to be ok.

Silverlight 2 SDK and Documentation

March 5, 2008