Andrew Connell [MVP MOSS]
1531 Posts |  42 Articles |  4706 Comments
.NET  |  MCMS  |  SharePoint  |  Office System
SharePoint Quick Links
Article Categories
Archives
Post Categories


Add to Technorati Favorites

I’ve been struggling trying to work with the new SharePoint 2010 Silverlight client object model on a new environment I setup. This has SharePoint 2010 Beta 2 and Visual Studio 2010 Beta 2… nothing special, that’s it (along with the dependencies such as SQL Server and everything they require).

To work with the Silverlight client object model you have to add two references to your Silverlight project. These two assemblies (Microsoft.SharePoint.Client.Silverlight.dll & Microsoft.SharePoint.Client.Silverlight.Runtime.dll). These can be found in the [..]\14\TEMPLATES\LAYOUS\ClientBin folder. However I was having an issue.

After opening Visual Studio 2010 Beta 2, I created a Silverlight application that targeted .NET 3.5. When prompted I let the project wizard create an associated ASP.NET Web application to test it. Everything was good… until I tried to add a reference to the two SharePoint Silverlight client object model assemblies. When I added them, they appeared with  little warning icons… which you know is not good. So I jump to the code file MainPage.xaml.cs and try to add some using statements… specifically to Microsoft.SharePoint. Uh oh… it won’t resolve!

What gives?

Well get this: when you create a new project and accept the default path, it goes in something like this: c:\users\[username]\documents\Visual Studio 2010\Projects\[Solution/Project Name]. When I moved the project to a more shallow path such as c:\Demos\[Solution/Project Name] & opened it in Visual Studio 2010 beta 2, it worked just fine!

The skinny: It appears that if you have a deep path, Visual Studio 2010 has trouble referencing some assemblies… for me, that’s the SharePoint 2010 Silverlight client object model. The fix: don’t work with projects nested deep in folders. I’ll file this as a bug and cross my fingers.

posted on Thursday, November 19, 2009 6:39 AM

Feedback

# re: FYI – Interesting Little Bug in VS 2010 Beta 2 when working with the SharePoint 2010 Silverlight Client Object Model 11/19/2009 9:00 AM Jonathan Mast
Gravatar AC: awesome! I had this issue in the tech preview as well. Was driving me crazy!

Thanks for the help.

# re: FYI – Interesting Little Bug in VS 2010 Beta 2 when working with the SharePoint 2010 Silverlight Client Object Model 11/24/2009 12:18 PM Vimal Subramaniam
Gravatar Another little trick is to copy the client OM assemblies, Microsoft.SharePoint.Client.Silverlight.dll & Microsoft.SharePoint.Client.Silverlight.Runtime.dll from 14 hive ("C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\ClientBin") locally to your project and everything resolves just fine.

Vimal

# re: FYI – Interesting Little Bug in VS 2010 Beta 2 when working with the SharePoint 2010 Silverlight Client Object Model 11/30/2009 9:40 PM Bil Simser
Gravatar I never develop in the C:\users\blah\blah\blah path. It's crazy. I do all my work in d:\development. A way to get around this problem (other than what AC mentions) is if you're really enamoured with the default path (and you *can* change the default in Visual Studio if you want) is to use a subst command on the folder. Just do this from a command prompt:

subst x: c:\users\[username]\documents\Visual Studio 2010\Projects

Now all your projects can be x:\Project Name.

Post Feedback

Title:
Name:
Email:
(email will not be displayed)
Url:
Comments: 
Please add 6 and 1 and type the answer here:    
All Comments Are Filtered & Moderated
Unfortunately comment spammers are just too effecient and are constantly dirtying up blogs with irrelevant and unwanted comments trying to improve their standing on search engines. All comments on this blog are moderated. I do not censor comments, but I don't approve comments with vulger language or those soliciting products. Most of the time comments are approved within a few hours of being submitted with the only exception when I'm traveling.

Why are you asking for my email address?
The only reason I'm asking for your email address, which isn't required to submit a comment, is to provide a gravatar if you've created an account for yourself and associated your email address with a small image. If you have a gravatar created for the email address you submit, it will appear next to your comment. Otherwise nothing will appear.

What is a gravatar?
A gravatar is a "globally recognized avatar." You can get more information about gravatars, as well as create your own for free, at www.gravatar.com. You can also view my gravatar here.


Copyright © 2003 - 2010 Andrew Connell
Creative Commons License 
This work is licensed under a Creative Commons License
Site design by Heather Solomon.

 
 
MOSS WCM Training
Looking for MOSS 2007 WCM developer training? Look no further! I teach my 5-day hands-on and online WCM classes for developers I offer through my company: Critical Path Training.

Get more information on the WCM courses!