Karine Bosch’s Blog

On SharePoint

Integrating Silverlight 3 in SharePoint 2007


Silverlight 3 has been released last week and it comes with really really great features. To learn more about them, I refer to posts like those of Tim HeuerScott Guthrie and Shawn Wildermuth. And a blog I personally like very much is the blog of Mike Snow.  Besides those listed here, there are a lot of other interesting resources you can find on the net.

All these new features sounds very exciting. Today I have been trying to integrate Silverlight 3 into SharePoint and it has not been easy at all.

Installation of Silverlight 3

 – Download Silverlight 3 runtime and install

– Download the Silverlight 3 SDK and install 

– If you are a developer, download Silverlight 3 Tools for Visual Studio and install. If you run  your environment in a Virtual PC (like most of the SharePoint developers do) you will encounter problems when you have no internet connection from within your Virtual PC. Until the beta version of Silverlight 3 you could use the trick to copy the content of the temporary folder while the exe was aching to install, and then install everything separately, but this time you will not find the Silverlight.3.x_Developer.exe file to enable Silverlight debugging in Visual Studio so you DO need an internet connection this time. (To enable internet access from within your VPC, I can recommend this post).

– If you need to develop more advanced user interfaces (and you will), you can download and install the Blend 3 trial.

If you installed all these bits, you are ready to go. Open Visual Studio 2008 and you can start developing your first Silverlight 3 applications. Exciting isn’t it? But if you are a SharePoint developer like me, there is the next hurdle to take: how can I display my first Silverlight 3 application in SharePoint? The SharePoint path has always been steep and has never been easy to take.

Configuration of the SharePoint server

Here comes the good news: in despite of previous versions, with Silverlight 3 you have to change NOTHING to the web.config of your SharePoint web application(s) on the server. You only have to configure the web.config for Framework 3.5 but this can easily lazily be done by Visual Studio 2008.

The last week I received a lot of questions on my blog: “Where is the System.Web.Silverlight.dll? I can’t find it.”. Well, I’m sorry, but it doesn’t exist anymore. You have to create the silverlight applications from within javascript, at least if you want to stay compatible.

Consequences for the SharePoint developer

You have two options:

– You are conservative and you install the Silverlight 3 SDK side by side with the Silverlight 2 SDK. In that case you can continue using the SilverlightControl, even with Silverlight 3 applications. 

– You are progressive and you remove the Silverlight 2 SDK and install the Silverlight 3 SDK. In that case you have to change your code.

The conservative way

Install the Silverlight 3 SDK side by side with the Silverlight  2 SDK. In that case the System.Web.Silverlight.dll is still available and can be deployed in the Global Assembly Cache, and you can continue using the Silverlight control, residing in that System.Web.Silverlight.dll. The control works with Silverlight 2 and Silverlight 3 applications.

PS. I haven’t checked HttpWebRequest to call SharePoint web services, so I don’t know if that’s boobytrapped too. 

The progressive way

Update 25/07/2009: because of encountering problems with execution of the script inside the web part code, I altered this post slightly.

This post explains how you can create a SharePoint web part that hosts a Silverlight 3 application. In a following post you will read how to host a Silverlight 3 application from within an application page. Both techniques are the basics that can be used in every SharePoint development scenario.

Create a javascript file with f.e. the name SpSilverlight.js. Include the following script to create a Silverlight application based on the silverlight.CreateObjectEx method:

function onSilverlightError(sender, args) {
         var appSource = "";
         if (sender != null && sender != 0) {
            appSource = sender.getHost().Source;
         }

         var errorType = args.ErrorType;
         var iErrorCode = args.ErrorCode;
         if (errorType == "ImageError" || errorType == "MediaError") {
             return;
         }
         var errMsg = "Unhandled Error in Silverlight Application " +  appSource + "\n" ;
         errMsg += "Code: "+ iErrorCode + "    \n";
         errMsg += "Category: " + errorType + "       \n";
         errMsg += "Message: " + args.ErrorMessage + "     \n";
         if (errorType == "ParserError") {
             errMsg += "File: " + args.xamlFile + "     \n";
             errMsg += "Line: " + args.lineNumber + "     \n";
             errMsg += "Position: " + args.charPosition + "     \n";
         }
         else if (errorType == "RuntimeError") {          
             if (args.lineNumber != 0) {
                 errMsg += "Line: " + args.lineNumber + "     \n";
                 errMsg += "Position: " +  args.charPosition + "     \n";
             }
             errMsg += "MethodName: " + args.methodName + "     \n";
         }
         throw new Error(errMsg);
}
function createSL(divid, swidth, sheight, source, initparameters)
{
    var pluginid = divid + "Plugin";
    var divElement = document.getElementById(divid);
    var altHTML = divElement.innerHTML;
    if (swidth == null)
       swidth='100%';
    if (sheight == null)
       sheight='750px';     
    Silverlight.createObjectEx(
    {
        source: source,
        parentElement: divElement,
        id: pluginid,
        properties:
        {
          // Plug-in properties
          width:swidth, 
          height:sheight,
          minRuntimeVersion:'2.0.31005.0'
        },
        events:
        {
           OnError: onSilverlightError // OnError property value -- event-handler function name.
           // OnLoad property value -- event-handler function name.
        },
        initParams: initparameters
    });
}

You can also create a Silverlight object using the silverlight.CreateObject method and include that in the SpSilverlight.js file.

In your web parts in the OnPreRender event you will have to register following javascript files:

  •  the Silverlight.js file (which comes with Silverlight and can be found in the C:\Program Files\Microsoft SDKs\Silverlight\v3.0\Tools directory)
  • the SpSilverlight.js file you just created.
protected override void OnPreRender(EventArgs e)
{
     base.OnPreRender(e);
     ClientScriptManager cs = Page.ClientScript;// Include the required javascript file.
     if (!cs.IsClientScriptIncludeRegistered("sl_javascript"))
         cs.RegisterClientScriptInclude(this.GetType(), "sl_javascript", "/_LAYOUTS/SL3/Silverlight.js");
     if (!cs.IsClientScriptIncludeRegistered("spsl_javascript"))
         cs.RegisterClientScriptInclude(this.GetType(), "spsl_javascript", "/_LAYOUTS/SL3/SpSilverlight.js");
}

Notice the path to the javascript files. I both deployed them to a sub folder of the 12\TEMPLATE\LAYOUTS folder. To avoid having to deploy these files for each web part and application page, you can best deploy them once to a single sub folder of the 12\TEMPLATE\LAYOUTS folder. You can also deploy them to the ClientBin folder under your SharePoint web application (in IIS).

Call the above javascript from within the CreateChildControls method:

protected override void CreateChildControls()
{
    string slstring = "<script type=\"text/javascript\">"
       + "createSL('silverlightHost', '300', '100', '/_LAYOUTS/SL3/HelloSilverlight3.xap', null);"
       + "</script>";
    silverlightHost = new LiteralControl(string.Format("<div id=\"silverlightHost\" style=\"width:100%; height:100%\"></div>{0}", slstring));           
    this.Controls.Add(silverlightHost);
}

If you need to pass data to the Silverlight control you need to set the initParams argument. This is a comma delimited string which has the following syntax:

key1=value1,key2=value2,...

Note that there are no spaces.

The CreateChildControls method would look as follows:

protected override void CreateChildControls()
{
    string xaplocation = "/_LAYOUTS/SL3/HelloSilverlight3.xap";
    string initparams = string.Format("url={0},list=Shared Documents", SPContext.Current.Web.Url);
    string slstring = string.Format("<script type=\"text/javascript\">"
       + "createSL('silverlightHost', '300', '100', '{0}', '{1}');"
       + "</script>", xaplocation, initparams);
    silverlightHost = new LiteralControl(string.Format("<div id=\"silverlightHost\" style=\"width:100%; height:100%\"></div>{0}", slstring));           
    this.Controls.Add(silverlightHost);
}

Voila! If you get this easy one to work, you are ready to go for all the great new stuff Silverlight 3 brings you!

Have fun!

July 17, 2009 - Posted by | SharePoint 2007, Silverlight

90 Comments »

  1. Hi Karine and thanks for your highly insightful blog!

    I struggled as if I was mad trying to create a webpart through using the SilverLight control with 3.0 and was blown away that it disappeared from the SDK server folder but Alas my trail of insanity has finally ended here, to which I am grateful for your help!

    I would like to know how does one set the InitParameters using the progressive way? I am attempting to pass a List Guid through to the SilverLight control.

    Comment by John | July 22, 2009 | Reply

  2. OK I should have taken more time to read through the code..

    I think I see how the initparms are passed through..

    .
    .
    createSL(‘silverlightHost’, ‘300’, ‘100’, ‘/_LAYOUTS/SL3/HelloSilverlight3.xap’, “<>”);”
    .
    .

    Thanks

    Comment by John | July 22, 2009 | Reply

  3. I keep getting a js error, object not found. the debugger highlights the path to the xap file. I’ve tried several different paths.

    Comment by greg | July 22, 2009 | Reply

  4. I getting an error “object not found” on the xap path. Not sure why?

    protected override void CreateChildControls()
    {
    string slstring = “”
    + “createSL(‘silverlightHost’, ‘300’, ‘100’, ‘/_LAYOUTS/ClientBin/SLApp.xap’, null);”
    + “”;
    LiteralControl silverlightHost = new LiteralControl(string.Format(“{0}”, slstring));
    this.Controls.Add(silverlightHost);
    }

    protected override void OnPreRender( EventArgs e )
    {
    string scriptstring = “” + “function createSL(divid, swidth, sheight, source, initparams)”
    + “{alert(source);”
    + ” var pluginid = divid + ‘Plugin’;”
    + ” var parentElement = document.getElementById(divid);”
    + ” var altHTML = parentElement.innerHTML;”
    + ” Silverlight.createObject(”
    + ” source,”
    + ” parentElement,”
    + ” pluginid,”
    + ” {”
    + ” // Plug-in properties”
    + ” width:’700′, ”
    + ” height:’1200′,”
    + ” minRuntimeVersion:’3.0.40624.0′,”
    + ” alt:altHTML”
    + ” },”
    + ” {”
    + ” onError:null,”// OnError property value — event-handler function name.
    + ” onLoad:null ” // OnLoad property value — event-handler function name.
    + ” },”
    + ” initparams,null);”
    + ” }”
    + “”;
    if (!Page.ClientScript.IsClientScriptBlockRegistered(“spsl”))
    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), “spsl”, scriptstring);
    }

    Comment by greg | July 23, 2009 | Reply

  5. Greg,
    Where have you deployed the .xap file and what is the path you specify as source property?
    Greetz,
    Karine

    Comment by Karine | July 23, 2009 | Reply

    • I figured out the problem. CreateChildControls is firing before the OnPreRender event, so the “object’ that cannot be found is the createSL function.

      Comment by Greg | July 23, 2009 | Reply

      • Sorry, on second thought, I don’t think this is the problem.

        Comment by Greg | July 23, 2009

      • I thought that the Silverlight dll was removed in version 3? If I use the same webpart code that I use for SL ver 2, it works.

        […]

        using System.Web.UI.SilverlightControls;

        public class mywebpart: WebPart
        {
        private string _XapLocation = @”http://localhost:1856/ClientBin”;

        Silverlight silverlightControl = null;

        public mywebpart()
        {
        this.ExportMode = WebPartExportMode.All;
        }

        [Personalizable( true ), WebBrowsable(), WebDisplayName( “XapLocation” )]
        public string XapLocation
        {
        get { return _XapLocation; }
        set { _XapLocation = value; }
        }

        protected override void OnInit( EventArgs e )
        {
        base.OnInit( e );
        ScriptManager scriptManager = ScriptManager.GetCurrent( this.Page );
        if(scriptManager == null)
        {
        scriptManager = new ScriptManager();
        this.Controls.AddAt( 0, scriptManager );
        }
        }

        protected override void CreateChildControls()
        {
        base.CreateChildControls();
        silverlightControl = new Silverlight();
        silverlightControl.ID = “ChicosSL1”;
        silverlightControl.Source = string.Format( “{0}/mysl.xap”, _XapLocation );
        silverlightControl.Width = Unit.Pixel( 1100 );
        silverlightControl.Height = Unit.Pixel( 1400 );
        silverlightControl.MinimumVersion = “2.0”;

        Controls.Add( silverlightControl );
        }
        }

        Comment by Greg | July 23, 2009

  6. Greg,

    If your code from SL2 is still working, then it is because the System.Web.Silverlight.dll is still in the GAC. This is no problem, you can work that way.

    If you really want to work the SL3 way, you will have to go for the silverlight.createObject way. Your source property seems a bit weird to me: _LAYOUTS means that you deployed to the 12/TEMPLATE/LAYOUTS folder while your SL2 code leads to assume that you created a ClientBin folder in your IIS web application. In that case you will have to specify:
    createSL(‘silverlightHost’, ‘300″, ‘100’, ‘/ClientBin/SLapp.xap’, null)
    Greetz,
    Karine

    Comment by Karine | July 24, 2009 | Reply

    • Thanks, Karine. Did you mean to use minRuntimeVersion:’2.0.31005.0′ or minRuntimeVersion:’3.0.40624.0′ in the createSL func?

      Comment by Greg | July 29, 2009 | Reply

  7. H Karine,
    Great article. I need to get up to date on this myself, so I guess I’ll just start here 😉

    Keep it up!

    Comment by Tobias Zimmergren | July 28, 2009 | Reply

  8. […] 3 with SharePoint provides you with help on getting Silverlight 3 going in SharePoint 2007. See https://karinebosch.wordpress.com/2009/07/17/integrating-silverlight-3-in-sharepoint-2007/ Posted by Scott Samuels Development Subscribe to RSS […]

    Pingback by Get SharePoint 2010 Now! | Scott Samuels' Blog | July 28, 2009 | Reply

  9. […] the implementation has changed somewhat.  Karine Bosche has very kindly gone to the trouble of blogging how to get your Silverlight 3 applications running in WSS 3.0 and MOSS 2007.  Time to roll up […]

    Pingback by SharePoint and Silverlight 3 « Life, the universe and whatever | July 30, 2009 | Reply

  10. […] Integrating Silverlight 3 in SharePoint 2007 « Karine Bosch’s Blog […]

    Pingback by Daily Blog Post 08/04/2009 « Murratore’s Weblog | August 4, 2009 | Reply

  11. Thanks for the walkthrough. Here’s a literal control wrapper class that may simplify things (visual studio 2008).

    First, here’s how to use it:

    protected override void CreateChildControls()
    {
    base.CreateChildControls();

    SilverLightWrapper chartCtl = new SilverLightWrapper(SilverWidth, SilverHeight, XAPLocation, initParams);
    this.Controls.Add(chartCtl);
    }

    //Here’s the control:

    using System;
    using System.Text;
    using System.Web.UI;

    //note that the iframe is required for safari to work //properly
    namespace AIMTeam.WssDashboard.Display
    {
    public class SilverLightWrapper : LiteralControl
    {
    private const String SilverLight3Version = “3.0.4.0”; //”3.0.40624.0″;

    public Int32 Width { get; set; }
    public Int32 Height { get; set; }
    public String XapLocation { get; set; }
    public String InitParameters { get; set; }
    public String MinRuntimeVersion { get; set; }

    public SilverLightWrapper(Int32 Width, Int32 Height, String XapLocation, String InitParams)
    {
    this.Width = Width;
    this.Height = Height;
    this.XapLocation = XapLocation;
    this.InitParameters = InitParams;
    MinRuntimeVersion = SilverLight3Version;
    this.Text = GetControlString();
    }

    public SilverLightWrapper()
    { }

    private String GetControlString()
    {
    StringBuilder ctl = new StringBuilder();

    ctl.Append(“”);
    ctl.Append(“”);
    ctl.Append(“”);
    ctl.Append(“createSL(‘silverlightHost’, “);
    ctl.Append(“‘” + Width.ToString() + “‘,”);
    ctl.Append(“‘” + Height.ToString() + “‘,”);
    ctl.Append(“‘” + XapLocation + “‘,”);
    ctl.Append(“‘” + InitParameters + “‘);”);
    ctl.Append(“”);

    return ctl.ToString();
    }
    }
    }

    Comment by hai quan | August 6, 2009 | Reply

    • hmmm… the blogging engine took out most the the scripting text that was in that control…

      Comment by hai quan | August 6, 2009 | Reply

  12. Hi Karine,

    Getting an pop-up box when I tried your approche.
    Pop-up is saying
    As a title “message from webpage”
    and a body “end”
    The SL3 app is working fine by it’s own.
    Any suggestions?

    Thanks,
    Robin

    Comment by Robin | August 16, 2009 | Reply

    • sorry, turns out removing that from the js file did wonders :s

      Comment by Robin | August 16, 2009 | Reply

  13. I got the js error saying the file extension cannot be downloaded. Then i added the MIME entry to the webapplication in IIS as recommended by other blogger then it works, Thank you.

    Comment by Senthamil | August 25, 2009 | Reply

  14. I tried this and it shows me nothing. No errors, just the title of the web part and no silverlight control. I tried accessing the xap file through http://sharepoint/_layouts/sl3/sltrial.xap, and it serves me the xap file for downloading. I cannot figure out what is wrong. Any leads on where I could be going wrong. I am using the exact same code without any modifications.

    Comment by Samrit | September 23, 2009 | Reply

  15. Hi Samrit,
    But this is the correct way to host Silverlight in SharePoint. I’m doing nothing else the past days.
    Check the following:
    – in Internet Explorer delete all files from cache
    – check the source property
    – check width and height of the silvelright control
    – check width and height of the div hosting the silverlight control.
    This should work.
    Karine

    Comment by Karine Bosch | September 24, 2009 | Reply

  16. Hi Karine,
    Thanks very much for the code. I have everything working in SharePoint except passing the parameters. I see where they are passed, but I’m wondering about the syntax. If I want to pass two parameters, can you tell me how to write the string?
    Thanks!

    Comment by Jennifer | September 29, 2009 | Reply

  17. Hi Jennifer,
    I added a piece of code that demonstrates the use of initparams at the bottom of my post. I hope this helps. If not, please let me know.
    Karine

    Comment by Karine Bosch | September 29, 2009 | Reply

  18. Hi Karine,
    The code you provided worked great! I now have a web part with two properties that can be passed in from SharePoint. My next question is that I would like to be able to retain the unique property values set by every SharePoint user. I thought I could accomplish this by setting the properties in my code to: Personalizable(PersonalizationScope.User) but when I log into SharePoint as Bob, and change a property value, I also see that change when I log in as Jen. Do you know what else I might have to set up to get this to work?
    Jen

    Comment by Jennifer | October 2, 2009 | Reply

  19. Hi Jen,

    This is weird because Personalizable(PersonalizationScope.User) is the way to go. If I have time this weekend, I’ll try something out.

    Karine

    Comment by Karine Bosch | October 2, 2009 | Reply

  20. Hi Karine,
    No need to spend your weekend on this one! I did some more experimenting in SharePoint and found that I was just not selecting the correct settings. From the Welcome dropdown list there are two options; ‘Show Shared View’ and ‘Show Personal View’. When I open the Web Part in ‘Show Shared View’, then can then edit the Web Part with the option ‘Modify Shared Web Part’. These changes can be seen by everyone if in ‘Shared View’. When I open the Web Part in ‘Show Personal View’ I get ‘Modify My Webpart’ instead which is the option that will allow my personalized items to stick.
    Thanks for your quick responses to my questions.
    Jen

    Comment by Jennifer | October 2, 2009 | Reply

  21. Hello, I am hoping for some insight. I am not new to SL dev, but I am new to SharePoint web parts. I have followed your example and everything works perfectly (thank you for that) however, I am completely unclear as to how to enable debugging my silverlight code. The debugger breaks on Web part code, but I get the “Symbols have not been loaded” thingy on all bp’s in my silverlight code. PLEASE if at all possible, step me through this as I am trying to push SL dev in sharepoint here at work, and I’m kind of all alone on this (they are really resisting the change).

    Thank you very much,
    Chris

    Comment by Chris | October 9, 2009 | Reply

  22. Hi Chris,
    You can easily debug your silverlight code by attaching the debugger to the iexplorer.exe process from within Visual Studio. Please, let me know if this is not clear enough. In that case I’ll make a separate blog post for it.
    Greetz,
    Karine

    Comment by Karine Bosch | October 9, 2009 | Reply

    • Hi Karine,

      First, thanks for the great article. It’s been a huge help. I am hoping you can help me with a debugging problem. When I attach the debugger to the iexplore process (making sure that type is Silverlight), none of my breakpoints are hit and the symbols do not load. I have a SL class library project that builds the XAP file, and on build it copies the .xap file to a folder in the 12\Template\Layouts folder. This is the location I reference in the web part I created to host the SL control.It seems that this is causing a problem with debugging..any suggestions?

      Thanks,
      Larkin

      Comment by Larkin | October 13, 2009 | Reply

  23. Thank you for the quick reply, this does work and helps me very much (I’ll put you on my Christmas card list :), I was actually attaching to the w3wp.exe process. Now that it works maybe you can point me into another direction, how would batch automate this so I can simply hit F5? The build, deploy, run F5 then attach is kinda slow and a bit of a pain.

    Thanks again,
    Chris

    Comment by Chris | October 9, 2009 | Reply

  24. Hi Chris,
    Unfortunately I have no (quick) reply for this: I always do it manually. Perhaps I’ll take a look at it over the weekend. Perhaps this can put you in the right direction: you can define post-build commands in the Project Properties (right-click project in Solution Explorer, choose Properties and select the Build Events tab). A lot of people use this to deploy the solution automatically.
    But the weekends starts for me now 🙂
    Greetz,
    Karine

    Comment by Karine Bosch | October 9, 2009 | Reply

  25. Thanks again Karine, I will google the auto attaching a process thing, as everything else I have is automated (deployment) and works fine.

    Have a nice weekend,
    Chris

    Comment by Chris | October 9, 2009 | Reply

  26. Hi Larkin,

    The way you deploy the .xap file and the way you attach the iexplorer process is just fine. But sometimes Internet Explorer caches the Silverlight application. Try to delete browser history and refresh the page. Then attach to the iexplorer process from within Visual Studio and try to debug again. This should solve your problem.
    Karine

    Comment by Karine Bosch | October 13, 2009 | Reply

  27. Hello Karine,
    I have one question….
    This is my sharepoint webpart code.
    From this i am passing a Feed Url as Init parameter to the Silverlight Control.

    using System;
    using System.Runtime.InteropServices;
    using System.Web.UI.SilverlightControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Serialization;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    using Microsoft.SharePoint.WebPartPages;
    using System.Xml.Schema;
    using System.Xml;
    using System.Net;
    using System.IO;
    using System.Web.UI;
    using System.ComponentModel;

    namespace WebFeeds
    {
    [Guid(“e8d6b010-c5fa-4e84-b585-67ff9b9a41f4”)]
    public class WebFeedsWP : System.Web.UI.WebControls.WebParts.WebPart
    {
    Silverlight sl = new Silverlight();
    private string xmlUrl;
    [Personalizable(PersonalizationScope.Shared),
    WebBrowsable(true),
    WebDisplayName(“Feed Url”),
    WebDescription(“Set your RSS feed’s XML URL here!”),
    Category(“Configuration”)]
    public string XmlUrl
    {
    get { return xmlUrl; }
    set { xmlUrl = value; }
    }
    public WebFeedsWP()
    {
    }

    protected override void OnLoad(EventArgs e)
    {
    base.OnLoad(e);
    ScriptManager sm = ScriptManager.GetCurrent(this.Page);
    if (sm == null)
    {
    sm = new ScriptManager();
    Controls.AddAt(0, sm);
    }
    }

    protected override void CreateChildControls()
    {
    base.CreateChildControls();
    Silverlight sl = new Silverlight();
    sl.ID = “Feeds”;
    //sl.Source = SPContext.Current.Site.Url+”/XAPs/SilverlightCoffee.xap”;
    sl.Source = “http://punib9345:1312/sites/NewList/BFSDocuments/WebServiceFeeds.xap”;
    sl.Width = new Unit(640);
    sl.Height = new Unit(193);
    sl.InitParameters = XmlUrl;
    Controls.Add(sl);

    }
    protected override void RenderContents(HtmlTextWriter writer)
    {
    if ( sl!= null)
    sl.RenderControl(writer);
    }
    }
    }

    In Silverlight Control,I am accessing this Initparameters like this…

    private void Application_Startup(object sender, StartupEventArgs e)
    {
    string siteUrl = null;
    if (e.InitParams != null)
    {
    siteUrl = e.InitParams[“XmlUrl”];
    }

    this.RootVisual = new MainPage(siteUrl);
    }

    But I am unable to get the output..
    The javascript Error which i am getting is…

    The given key was not present in the Dictionary at
    System.ThrowHelper.ThrowKeyNotFoundException()

    Can you please tell me how to Correct this?
    Thanks in advance

    Comment by Prasad | November 6, 2009 | Reply

    • Prasad,

      If I am reading your code correctly, you are simply passing the XmlUrl value to the initparams property. However, you need to pass it in a key/value format, such as:

      XmlUrl=http://somesite.com?xmlfeed=2 (Except you probably have to escape the special characters, no doubt)

      Otherwise, the Silverlight control has no way of knowing what the name of the key is.

      Hope that helps,
      Larkin

      Comment by Larkin | November 7, 2009 | Reply

  28. Hi Prasad,
    Thanks for reading my blog post. Can you please post your question to the MSDN forum at http://social.msdn.microsoft.com/forums/en-US/sharepointdevelopment/threads/.
    Greetz,
    Karine

    Comment by Karine Bosch | November 7, 2009 | Reply

  29. Hello Karine,
    Thanks for your reply,
    I have silverlight control,which uses webservices.when i run the code,it works perfectly fine.But when i add this control in Sharepoint it gives me following Exception…

    Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()

    I did lot of search about this error,its a cross domain issue.
    After this i added ClientAccessPolicy.xml file and CrossDomain.xml file in my root C:\Inetpub\wwwroot\wss\VirtualDirectories\1312

    But still i am getting the same error.
    My sharepoint Url is http://punib9345:1312/NewList

    My ServiceReferences.ClientConfig file is

    I am really not getting where i am going wrong and what settings i should change?

    Comment by Prasad | November 9, 2009 | Reply

  30. Hi Prasad,
    You have to add the clientaccesspolicy.xml to the root of your SharePoint web application using SharePoint Designer. It’s not working when you add it to the C:\Inetpub\wwwroot\wss\VirtualDirectories\1312 directory.
    Karine

    Comment by Karine Bosch | November 9, 2009 | Reply

  31. Really thanks for your reply,
    I added the Clientaccesspolicy.xml file through Sharepoint Designer.But still i am getting the same error.

    Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()\n at WebServiceFeeds.Rss_Service.GetRSSCompletedEventArgs.get_Result()\n at WebServiceFeeds.MainPage.rssSvc_ServiceCompleted(Object sender, GetRSSCompletedEventArgs e)\n at WebServiceFeeds.Rss_Service.WebService2SoapClient.OnGetRSSCompleted(Object state)”

    Comment by Prasad | November 9, 2009 | Reply

  32. Hello,

    really great post!
    I have a question that how can i add clientaccesspolicy.xml without sharepoint designer?

    Thanks,

    Comment by Nitin | November 10, 2009 | Reply

  33. Pfew, that I don’t know.

    Comment by Karine Bosch | November 10, 2009 | Reply

  34. Has created the application on silverlight 3, has added it in web part for WSS. Now I wish to add properties for web part in editing area (Editor Part). How to carry out through this property change of a background of the container in silverlight the appendix?

    Comment by Vitaliy | November 11, 2009 | Reply

  35. You can create your Editor Part as you normally do for a standard web part. The value of the property can then be passed using the InitParams parameter of the Silverlight control.

    Comment by Karine Bosch | November 11, 2009 | Reply

  36. Here my code:
    //Silverlight control

    public MainPage(string colorbg)
    {
    IntializeComponent();
    if (colori == “red”)
    {
    SolidColorBrush bg = new SolidColorBrush();
    bg.Color = Color.FromArgb(…);
    MainGrid.BackGround = bg;

    }…

    private void Application_Startup(object sender, StartupEventArgs e)
    {
    string сolor= null;
    if (e.InitParams != null)
    {
    color = e.InitParams[“COLOR”];
    }
    this.RootVisual = new MainPage(Color);
    }

    //Web part
    public enum colori
    {
    red,
    blue,

    }

    private colori Cvet = colori.red;
    [Personalizable(PersonalizationScope.Shared),
    WebBrowsable(true),
    WebDisplayName(“color”),
    WebDescription(“color”),
    Category(“Configuration”)]
    public colori Grbg
    {
    get { return Cvet; }
    set { Cvet = value; }
    }

    protected override void CreateChildControls()
    {
    string xaplocation = “/_LAYOUTS/XAP/CWEBpart.xap”;
    string initparams = string.Format(“url={0},list=Shared Documents,COLOR={1}”, SPContext.Current.Web.Url,Cvet);
    string slstring = string.Format(“”
    + “createSL(‘silverlightHost’, ‘140’, ‘460’, ‘{0}’, ‘{1}’);”
    + “”, xaplocation, initparams);
    silverlightHost = new LiteralControl(string.Format(“{0}”, slstring));
    this.Controls.Add(silverlightHost);
    }

    Correct, if I if have errors. Can it is necessary make changes in SpSilverlight.js?

    Comment by Vitaliy | November 11, 2009 | Reply

  37. […] If you want to know how to install Silvelright 3 and what you need to know before using Silverlight 3 with SharePoint, read this post. […]

    Pingback by Silverlight 3 Media Viewer Web Part for SharePoint « Karine Bosch’s Blog | January 8, 2010 | Reply

  38. […] Integrating Silverlight 3 in SharePoint 2007 Silverlight 3 has been released last week and it comes with really really great features. To learn more about them, I refer to posts like those of Tim Heuer, Scott Guthrie and Shawn Wildermuth. And a blog I personally like very much is the blog of Mike Snow. Besides those listed here, there are a lot of other interesting resources you can find on the net. […]

    Pingback by ÁghyBlog » links for 2009-09-09 | January 15, 2010 | Reply

  39. Wow, Thank´s a lot! This solution works perfectly. You have my respect 🙂

    Comment by Lukáš Toman | February 2, 2010 | Reply

  40. Hi Karine,

    I’m trying to get your samples to work, but with no sucess.

    First I’m developing in a virtual machine that runs in vmware, it has Windows Server 2003, Visual Studio 2008 and MOSS 2007.

    I’ve deployed some of your samples, but no render done. For instance, in the application hosting sample, I go to the page, the “Hello World” control is there (because I right click and it show that it’s a silverlight 3 control) but it does show anything, doesn’t render the control.

    Have you any clue. Can it be because I’m running it on vmware.

    Thanks

    Regards

    Paulo

    Comment by Paulo Cancela | April 7, 2010 | Reply

  41. Hi Paulo,
    In my opinion, it has nothing to do with you running in vmware.
    I have a couple of questions:
    – have you made the hello.xap file yourself?
    – Where have you deployed the .xap file?
    – Is that the URL you used for the Source argument of the Silverlight control?
    Karine

    Comment by Karine Bosch | April 7, 2010 | Reply

  42. Hi Karine,
    I have developed a silverlight application and integrated it in Sharepoint. But when I deployed that solution, Silverlight page is not getting load. The page is just displaying 100% and blue circle revolving around it. An error is alo thrown.

    Error: Unhandled Error in Silverlight Application. The given key was not in dictionary.

    What it not to work? I am not getting.

    Can you please help me? Waiting for your valuable response.

    Thanks,
    Kaustubh.

    Comment by Kaustubh | April 19, 2010 | Reply

  43. It seems that in the Startup method of the Silverlight application you want to retrieve a key from the InitParams dictionary that does not exist. Do you pass in arguments in the initparams attribute from within your SharePoint web part? Do they correspond with the one you try to read from the InitParams dictionary?

    Comment by Karine Bosch | April 19, 2010 | Reply

    • Hi Karine,
      Thanks for you reply. If possible, can you explain it with some code snippet. I am new in Sharepoint and Silverlight.
      I think The above error is regarding query string. When I am using following statements in my silverlight application, error occurs. If i comment it, it works properly.

      if (System.Windows.Browser.HtmlPage.Document.QueryString[“ID”] != null)

      dbid = System.Windows.Browser.HtmlPage.Document.QueryString[“ID”].ToString();

      How should I pass the initparams attribute within SharePoint?
      Thanks again.
      -Kaustubh

      Comment by Kaustubh | April 20, 2010 | Reply

  44. Hi,
    If you have the necessary information in your QueryString, you can use that from within Silverlight. If your error occurs at that point in your code, it means that you don’t have the ID argument in your QueryString.

    I use the following in my code to test on existance of QueryString arguments:

    // also retrieve the item ID from the querystring
    if (HtmlPage.Document.QueryString.ContainsKey(“ID”))
    {
    int.TryParse(HtmlPage.Document.QueryString[“ID”].ToString(), out ItemID);
    }

    Can your perhaps post your querystring?

    Comment by Karine Bosch | April 20, 2010 | Reply

  45. Hi Karin,
    Can i also use the Progressive way when creating
    .net custom Webpart hosting silverlight as supposesd Share point? and also how do i then communicate (in a bi-directional way) from my host (hosting the silverlight plugin) the webpart code to the Silverlight controls ?
    I am not sure how to do this if i have to use the SilverLight.CreateObject method() i would not know how to use the Html Dom from here…

    here is my code:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Linq;
    using System.Text;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;

    namespace SLRoomHostCctl
    {

    public class SLRoomConsumerPart : WebPart
    {

    /**************************************************Test Area***********************************************/

    private IStringForCalendar _myProvider;
    private string _stringTitle;
    private Calendar myCalendar;

    [ConnectionConsumer(“Calendar Title Consumer”, “CalendarTitleConsumer”)]
    public void RetrieveTitle(IStringForCalendar Provider)
    {
    _myProvider = Provider;
    }

    protected override void OnPreRender(EventArgs e)
    {
    EnsureChildControls();

    if (_myProvider != null)
    {
    _stringTitle = _myProvider.CalendarString.Trim();
    myCalendar.Caption = _stringTitle;
    }
    }

    /***********************************************************************************************************/

    [Personalizable(PersonalizationScope.Shared), WebBrowsable(true), Category(“Silverlight Settings”), WebDisplayName(“XAP Path”)]
    public string XapPath { get; set; }
    [Personalizable(PersonalizationScope.Shared), WebBrowsable(true), Category(“Silverlight Settings”), WebDisplayName(“Parent Width”)]
    public string ParentWidth { get; set; }
    [Personalizable(PersonalizationScope.Shared), WebBrowsable(true), Category(“Silverlight Settings”), WebDisplayName(“Parent Height”)]
    public string ParentHeight { get; set; }
    [Personalizable(PersonalizationScope.Shared), WebBrowsable(true), Category(“Silverlight Settings”), WebDisplayName(“Parent Border Enabled”)]
    public bool ParentBorderEnabled { get; set; }

    //constructor
    public SLRoomConsumerPart()
    {
    AllowClose = false;
    this.ExportMode = WebPartExportMode.All;
    }

    protected override void OnLoad(EventArgs e)
    {
    ////base.OnLoad(e);

    //get the script manager associated with the current page
    // ScriptManager oscriptManager =
    // ScriptManager.GetCurrent(this.Page);

    ////check whether the script manager is already registered to the page
    //if (oscriptManager == null)
    //{
    // oscriptManager = new ScriptManager();
    // Controls.AddAt(0, scriptManager);
    //}

    }

    protected override void CreateChildControls()
    {
    ////Controls.Clear();

    //base.CreateChildControls();

    //Silverlight oSilverlight = new Silverlight();
    //oSilverlight.ID = “SLWPID”;
    //oSilverlight.Source = “∼/ClientBin/SlWebPartApp.xap”;
    //oSilverlight.Width = Unit.Percentage(100);
    //Controls.Add(oSilverlight);

    ////ChildControlsCreated = true;

    try
    {
    XapPath = “ClientBin/SLRoomConsumerApp.xap”;

    base.CreateChildControls();
    if (string.IsNullOrEmpty(XapPath))
    {
    this.Controls.Add(new LiteralControl() { Text = “Update \”XAP Path\” in Silverlight Settings.” });
    }
    else
    {
    ////HttpContext.Current.User.Identity –to use

    //SPUser user = SPContext.Current.Web.CurrentUser;

    //string fullName = user.Name.Replace(“, “, “_”);
    string fullName = “Kingsley Test”;

    //Silverlight expects a comma delimited value. This is parsed back in the Silverlight Appplication_Startup method. See below.

    //string loginName = user.LoginName.ToLower();
    string loginName = “Kingsley”;

    //string email = user.Email.ToLower();
    string email = “matt@lom.com”;
    //string userParams = “FullName=” + fullName + “,LoginName=” + loginName + “,Email=” + email;

    string userParams = “FullName=” + fullName + “,LoginName=” + loginName + “,Email=” + email;
    if (string.IsNullOrEmpty(ParentHeight))
    {
    ParentHeight = “100”; //Defaults to 100 since otherwise nothing will be visible.
    }

    if (string.IsNullOrEmpty(ParentWidth))
    {
    ParentWidth = “100”; //Defaults to 100 since otherwise nothing will be visible.
    }

    StringBuilder styleScriptText = new StringBuilder();

    styleScriptText.Append(
    “” +
    “html, body” +
    ” {” + ” height: 100%;” +
    ” overflow: auto;” + ” }” +
    “body” + ” {” + ” padding: 0;” + ” margin: 0;” + ” }” +
    “” +
    “” +
    ” function onSilverlightError(sender, args) {” +
    ” var appSource = \”\”;” +
    ” if (sender != null && sender != 0) {” +
    ” appSource = sender.getHost().Source;” +
    ” }” +
    ” var errorType = args.ErrorType;” +
    ” var iErrorCode = args.ErrorCode;” +
    ” if (errorType == \”ImageError\” || errorType == \”MediaError\”) {” +
    ” return;” +
    ” }” +
    ” var errMsg = \”Unhandled Error in Silverlight Application \” + appSource + \”\n\”;” + ” errMsg += \”Code: \” + iErrorCode + \” \n\”;” +
    ” errMsg += \”Category: \” + errorType + \” \n\”;” + ” errMsg += \”Message: \” + args.ErrorMessage + \” \n\”;” +
    ” if (errorType == \”ParserError\”) {” + ” errMsg += \”File: \” + args.xamlFile + \” \n\”;” +
    ” errMsg += \”Line: \” + args.lineNumber + \” \n\”;” +
    ” errMsg += \”Position: \” + args.charPosition + \” \n\”;” +
    ” }” +
    ” else if (errorType == \”RuntimeError\”) {” +
    ” if (args.lineNumber != 0) {” +
    ” errMsg += \”Line: \” + args.lineNumber + \” \n\”;” +
    ” errMsg += \”Position: \” + args.charPosition + \” \n\”;” +
    ” }” +
    ” errMsg += \”MethodName: \” + args.methodName + \” \n\”;” +
    ” }” + ” throw new Error(errMsg);” +
    ” }” +

    “function showMessage(message) { alert(message);}” +
    “”);

    StringBuilder objectText = new StringBuilder();
    objectText.Append(styleScriptText.ToString() +
    “” +
    “” +
    “” +
    “” +
    “” +
    “” +
    “” +
    ” + “” +
    ” +
    “” +
    “” +
    “” + “”);
    Literal literal = new Literal()
    {
    Text = objectText.ToString()
    };

    this.Controls.Clear();
    this.Controls.Add(literal);

    /************************Test Area***********************/
    Literal ltBR = new Literal { Text = “” };
    Controls.Add(ltBR);

    //
    myCalendar = new Calendar();
    myCalendar.Visible = false;
    Controls.Add(myCalendar);
    /**********************************************************/

    //I need my sl object so that i can get data to the host to transport between webparts
    //SLRoomConsumerApp.MainPage page = new MainPage();

    }
    }
    catch (Exception ex)
    {
    //Handle error…

    }
    }

    }
    }

    Comment by Kingsley | June 9, 2010 | Reply

  46. You can also override the method RenderControl:

    public override void RenderControl(HtmlTextWriter writer)
    {
    base.RenderControl(writer);

    writer.WriteLine(“”);
    writer.WriteLine(” “);
    if (!string.IsNullOrEmpty(initParams))
    {
    writer.WriteLine(” “);
    }
    writer.WriteLine(” “);
    writer.WriteLine(” “);
    writer.WriteLine(”
    “);
    writer.WriteLine(“”);
    }

    Comment by Karine Bosch | June 10, 2010 | Reply

  47. mmm, code disappeared. Write me a mail at karinebosch at hotmail dot com and I’ll send you a code sample. And I’ll try to make a post of it somewhere this weekend.
    Karine

    Comment by Karine Bosch | June 10, 2010 | Reply

  48. Hi,

    I have hosted a silverlight control in sharepoint webpart using javascript. Since I am new to sharepoint webpart with silverlight, I have one query regarding hosting of silverlight control in webpart.

    1) I want to make resizable window from javascript you provided (spSilverlight.js).

    I would we great if you can provide some workaround.

    Thanks,
    Vivek

    Comment by Vivek Gupta | June 18, 2010 | Reply

  49. Hi Vivek,
    I made something like that work last week. I’ll try to blog about it on Sunday.
    Karine

    Comment by Karine Bosch | June 18, 2010 | Reply

    • Hi,

      Thanks for your reply.

      The exact Problem I am Facing is as follows:

      1) I am able to add two same silverlight webpart on same webpart page but only one works.

      2) If two same silverlight webpart are on same page but in different web part zone then they should adjust their sizes (resize automatically) on page refresh.

      I tried lot of techiques but unable to resize the javascript window.

      Thanks,
      Vivek

      Comment by Vivek Gupta | June 18, 2010 | Reply

  50. Hi Karine,

    Are you able to re-size javascript window? Waiting for your blog.

    Thanks,
    Vivek

    Comment by Vivek Gupta | June 21, 2010 | Reply

  51. This may be related to some of the questions asked above, but have you run into problems with a Silverlight control not stretching to its full height when hosted in a MOSS 2007 web part? I can take an SL app and view it in a standalone test page and the control will stretch to the full height of its contents. However, when I host that same control in a MOSS 2007 web part, the control won’t display unless I set an explicit height (e.g. 500px). Setting height to 100% in the createSL function call doesn’t have any effect. I assume it is caused by the heinous HTML rendered on most SharePoint pages, but I could be wrong.

    Any ideas?

    Thanks,
    Larkin

    Comment by Larkin | July 20, 2010 | Reply

  52. In regards to my previous post, something I noticed while troubleshooting the issue is that if render the object tag as a literal control the problem does not occur. It seems that using the createObjectEx function to render a Silverlight control has some disadvantages.

    Comment by Larkin | July 20, 2010 | Reply

  53. I spoke too soon. In a MOSS web part, even rendering the object tag explicitly doesn’t solve the problem.

    Comment by Larkin | July 20, 2010 | Reply

  54. Thank you Karine for the excellent post you made available on this. It is very well structured and helped me immensely in putting together information for my team. Your blog site and posts have been very helpful to our team and I applaud you for the excellent contributions. I have learned a lot from you.
    Well done !!!!!

    Comment by Johan Olivier | July 22, 2010 | Reply

  55. Hi Johan,
    Thanks for the credits on your blog! I really appreciate it.
    Karine

    Comment by Karine Bosch | July 22, 2010 | Reply

  56. This blog is priceless. Wish I would have found it a week ago.

    Comment by Paul | August 7, 2010 | Reply

  57. Hi,

    Does this work with Silverlight 4 ?

    Thanks

    Comment by Jean-Francois | May 9, 2011 | Reply

  58. Hi Jean-Francois,
    Yes, this also works with Silverlight 4.

    Comment by Karine Bosch | May 10, 2011 | Reply

  59. Hi
    Can you please let me know couple of things,

    string slstring = “”
    + “createSL(‘silverlightHost’, ‘300’, ‘100’, ‘/_LAYOUTS/SL3/HelloSilverlight3.xap’, null);”
    + “”;
    silverlightHost = new LiteralControl(string.Format(“{0}”, slstring));
    this.Controls.Add(silverlightHost);

    1- Did you host your site in SL3 folder in Layout or just copied /HelloSilverlight3.xap file over there?
    2- What is Silverlight Host? I could not find it it generates an error message.

    Regards

    Comment by Fari | May 24, 2011 | Reply

  60. 1. I deployed the Silverlight application (.xap file) to the layouts folder using a .WSP.
    2. The SilverlightHost control is the LiteralControl created in the line above.

    Regards,

    Comment by Karine Bosch | May 24, 2011 | Reply

  61. Thanks for your nice posting. But it is not working in Firefox Mozilla browser and Google Chrome.
    It is asking to download siverlight plugin everytime. But it is running in IE nicely.

    Can you please help me.

    Comment by rupesh | August 4, 2011 | Reply

  62. Hi rupesh,
    I’ll take a look at it this weekend.

    Comment by Karine Bosch | August 12, 2011 | Reply

  63. Hi,
    I am hosting a silverlight control in sharepoint webpart and using initparams passing the parameters.
    The problem is , if the client Browser is not having Silverlight, it gives a download link of Silverlight 3.0 by default. Is it posible to give download link of 4.0.And suppress the download link of 3.0

    Thanks

    Comment by sony | August 15, 2011 | Reply

  64. Yes, that should be possible: create a new Silverlight app using Visual Studio 2010 and look at the attributes within the tag. Change the minRuntimeVersion attribute and the link url inside the tag.

    Comment by Karine Bosch | August 15, 2011 | Reply

  65. Hi Karen,

    This is how code looks like.
    How do I get the Download link to point to SIliverLight 4.0

    protected override void CreateChildControls()
    {
    if (string.IsNullOrEmpty(this.GetListUrl()))
    {
    LoadEditPane();
    }
    else
    {
    LoadSilverlightChart();
    }
    base.CreateChildControls();
    }

    private void LoadSilverlightChart()
    {
    this.ChromeType = PartChromeType.TitleOnly;
    this.Weburl = string.IsNullOrEmpty(this.Weburl) ? XXXXXX.XAP_FILE : string.Empty;

    SilverlightWebPart myMediaCtrl = new SilverlightWebPart();

    myMediaCtrl.ID = this.ID;
    myMediaCtrl.Url = this.Weburl;

    if (string.IsNullOrEmpty(this.InitParams))
    {
    this.InitParams = “Part=XXXXXX”;
    }

    Comment by Sony | August 16, 2011 | Reply

  66. Sony, I need the code that instantiates the Silverlight application, not the web part.

    Comment by Karine Bosch | August 16, 2011 | Reply

  67. Hi Karen,

    I am using out of Box Silverlightwebpart which is there in Media And Content category.

    Thanks

    Comment by Sony | August 16, 2011 | Reply

  68. Hi Sony, I used reflector to take a look at the internals of the OOB SilverlightWebPart and I’m afraid that the version to download is hardcoded in the Microsoft.SharePoint dll. The CreateChildControls method contains the following:

    \r\n \r\n \r\n “, new object[] { SPResource.GetString(“GetSilverlightImageAlt”, new object[0]) });”

    So I don’t think you can change this behavior, unless you build your own SilverlightWebPart.

    Comment by Karine Bosch | August 16, 2011 | Reply

  69. mmm, the code does not want to be completely displayed but the hyperlink is hardcoded to download Silverlight 3.

    Comment by Karine Bosch | August 16, 2011 | Reply

  70. Hi Karine,

    I was able to integrate my silverlight 4 application in Sharepoint 2007 mostly with help from your blog. Thanks for the tutorial!!!….. My silverlight application needs information from an SQL database to work successfully. I’m trying to acheive this by using a WCF Service. I’ve successfully gotten this to work in VS by adding a Service Reference to my silverlight application but when I try to use it in my web part I recieve errors that uri( for the WCF Reference) can’t be found.

    Do you have any experience with integrating Silverlight and WCF Services in SharePoint 2007 as one web part? Or is this even possible?

    Comment by Ro0628 | February 6, 2012 | Reply

  71. Hi Ro0628,
    the only experience I have with a WCF Service in SharePoint 2007 was a WCF service that read SQL Server content, but just for demo purposes. I can’t remember having problems with the URI but I had to change the app.config file to change the binding attribute of the endpoint element into basicHttpBinding, but that was for Silverlight.
    There were also a number of changes in config files at the SharePoint site to make the WCF service accessible from within SharePoint, like defining a .svc file that needs to be deployed in a sub folder of the ISAPI folder, and a virtual path provider for WCF services.
    If you think that one of these things could be the root cause of your problems, please don’t hesitate to send me a mail at karinebosch at hotmail dot com and I’ll send you the article (that never was published) in which I describe in detail all steps to take.

    Comment by Karine Bosch | February 8, 2012 | Reply

  72. […] Integrating Silverlight 3 in SharePoint 2007 « Karine Bosch’s Blog […]

    Pingback by SharePoint Development Weekly Roundup (04Aug) | test | August 18, 2013 | Reply

  73. […] Integrating Silverlight 3 in SharePoint 2007 « Karine Bosch’s Blog […]

    Pingback by SharePoint Development Weekly Roundup (28Jul) | test | August 18, 2013 | Reply

  74. […] Integrating Silverlight 3 in SharePoint 2007 « Karine Bosch’s Blog […]

    Pingback by SharePoint Development Weekly Roundup (04Aug) | Jeremy Thake's musings | August 19, 2013 | Reply

  75. […] Integrating Silverlight 3 in SharePoint 2007 « Karine Bosch’s Blog […]

    Pingback by SharePoint Development Weekly Roundup (28Jul) | Jeremy Thake's musings | August 19, 2013 | Reply

  76. […] Integrating Silverlight 3 in SharePoint 2007 « Karine Bosch’s Blog […]

    Pingback by SharePoint Development Weekly Roundup (28Jul) | SharePointDevWiki.com | September 25, 2013 | Reply

  77. Hi Karine,

    I have an application in sharepoint 2007 with around 17 projects in a solution. It is a combination silver light and Console applications.I have to migrtae this to Sharepoint 2013 now. Now I am getting a build error System.Windows.controls (etc) are not available.But to this solution when I added a silver light project using Visual Studio 2013 templete, that project is building fine with all reference assemblies. Can you please help me and suggest how I can migrate this to sharepoint 2013 ? Creating new project and reuse code will be fine? Iam new to Silver light.
    It will be a great help !..

    Thanks in Advance
    Regards
    Nimisha

    Comment by Nimisha | November 19, 2014 | Reply

    • Hi Nimisha,
      I think your best option is to create a new project to have the references already right. Then copy in your code. I assume that you will have to redevelop certain things but that most of your code will run ok.
      Kind regards,
      Karine

      Comment by Karine Bosch | November 22, 2014 | Reply

  78. Hi Karine,

    Iam facing an issue in debugging silver light applictaion. Debugging is not firing when I attach to w3wp.exe normally.When I try to set attach to ‘Silver Light Type’ it is telling ; ‘Unable to attach to the process. The 32-bit version of the Visual Studio Remote Debugging Monitor (MSVSMON.EXE) cannot be used to debug 64-bit processes or 64-bit dumps. Please use the 64-bit version instead.’

    I ran the 64 bit MSVSMON.exe from ‘C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Remote Debugger\x64’ folder. And now my Task manager is also showing Visual Studio Remote Debugging Monitor from the X64 folder. But still Iam not able to debug my silver light webpart also a normal asp.net silver light applucation also.

    Iam stuck by this issue for a day. Can you please help me with some suggestions ? It will be agreat help..

    Thanks
    Regards
    Nimisha

    Comment by Nimisha | December 1, 2014 | Reply


Leave a comment