Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Add your ASP.NET and the Silverlight project to a common solution and the Visual Studio debugger will attach to the Silverlight application automatically while debugging the website project. You cannot attach two separate instances of Visual Studio to the same Internet Explorer instance, so you have to add both to the same solution and debug from there.</p> <p>You can either add the Silverlight project to your existing ASP.NET solution (right click solution, Add -> Existing Project) or create a new solution for times you want to debug both at the same time (create a new blank solution and add the existing projects, same as before).</p> <p>Here is the process to configure everything step-by-step after that. You can download this source files to the test solution here: </p> <p><a href="http://www.singulink.com/ClientFiles/StackOverflow/CrossProjectTest.zip" rel="nofollow noreferrer">http://www.singulink.com/ClientFiles/StackOverflow/CrossProjectTest.zip</a></p> <p>The projects are as follows:</p> <ul> <li>CrossProjectTest - Silverlight 4 project</li> <li>CrossProjectTest.Web - ASP.NET project that hosts the Silverlight application inside Index.html</li> <li>IFrameWebApp - ASP.NET project that has an <code>&lt;iframe&gt;</code> pointing to Index.html in the other ASP.NET project</li> </ul> <p>1) In the ASP.NET project that is hosting the Silverlight application, change the settings so it doesn't open a page when debugging and specify a port so that you can always reach it at a known address (which in this case will be <code>http://localhost:18000</code>). You don't want it to open a page because the IFrame ASP.NET project has the actual page you want to show. We still want it to hook the debugger into the web server process though, which is where step #3 will come in.</p> <p><img src="https://i.stack.imgur.com/7TfMS.png" alt="Setting port and start action"></p> <p>2) Point the <code>src</code> attribute of your <code>iframe</code> inside the IFrame project at the known address of the page that hosts the silverlight application in the other ASP.NET project, like so:</p> <pre><code>&lt;iframe width="100%" height="100%" src="http://localhost:18000/Index.html"&gt;&lt;/iframe&gt; </code></pre> <p>3) Right click on the <strong>solution</strong> file, and select Properties. Under "startup project" you will want to select "Multiple startup projects" and set the start action for both of your ASP.NET projects to "Start".</p> <p><img src="https://i.stack.imgur.com/mo8tB.png" alt="Setting multiple startup projects"></p> <p>4) Make sure Silverlight debugging is enabled inside BOTH the ASP.NET projects, especially the IFrame project for this particular scenario:</p> <p><img src="https://i.stack.imgur.com/f4yy7.png" alt="enter image description here"></p> <p>5) Set a breakpoint in your Silverlight application, press F5, and everything should launch. Because you set both ASP.NET projects to start, it will fire up both development web servers but only one internet browser, pointed to the IFrame project. I added a breakpoint in the App Startup of the Silverlight project just to demonstrate it getting hit:</p> <p><img src="https://i.stack.imgur.com/0kvSG.png" alt="enter image description here"></p> <p>6) Press F5 to continue execution and Silverlight should show up in the IFrame, as can be seen here:</p> <p><img src="https://i.stack.imgur.com/kG0I9.png" alt="enter image description here"></p> <p>7) Happily place breakpoints in any of the three projects and Visual Studio will debug all of them!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload