SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I build a visual web part in and I'm trying to embed a xap over it so that users who don't have Silverlight installed would see the asp content:

<object id="SilverlightPlugin1" width="300" height="400" data="data:application/x-silverlight-2," type="application/x-silverlight-2" > <param name="source" value="/content/SilverlightApplication1.xap"/> />

It all seems to work except the silverlight app doesn't seem to like that way of being embedded - the Chrome console gives the following error:

Uncaught Error: Unhandled Error in Silverlight Application Value cannot be null. Parameter name: webFullUrl at Microsoft.SharePoint.Client.ClientRuntimeContext..ctor(String webFullUrl) at Microsoft.SharePoint.Client.ClientContext..ctor(String webFullUrl) at SilverlightApplication1.MainPage.GetItemFromSharePointList() at SilverlightApplication1.MainPage..ctor() at SilverlightApplication1.App.Application_Startup(Object sender, StartupEventArgs e) at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)

I suspect it has something to do with me using ClientContext context = new ClientContext(ApplicationContext.Current.Url); in the silverlight code. Please give me some hints.

share|improve this question
up vote 1 down vote accepted

Got it, had to provide the context in the init params of my object tag.

<object id="SilverlightPlugin1" width="400" height="300" data="data:application/x-silverlight-2," type="application/x-silverlight-2" > <param name="source" value="/content/SilverlightApplication1.xap"/> <param name="initParams" value="MS.SP.url=<%= SPContext.Current.Web.Url %>"

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.