Visual Studio 2008 Debugging
Last post 05-13-2008 12:09 AM by mchlSync. 20 replies.
Sort Posts:
05-11-2008 6:34 PM
Visual Studio 2008 Debugging

 Hi,

 I recently installed Visual Studio 2008 Standard Edition and the Visual Studio 2008 Silverlight Tools Add-On. However, I'm having trouble debugging. I can't put a breakpoint anywhere in code ( it becomes an empty red circle and says: "No symbols have been loaded for this document" ). It has been suggested that I go to "Start Options..." by right clicking on the web project and checking the "Silverlight" box under the Debugging section, however I don't have that check box. The only box I have is ASP.NET.

 
Anyone know what the problem is?

Thanks in advance!

 

RegularKid

Joined on 02-03-2008
Souther California
Posts 38
05-11-2008 7:38 PM
Re: Visual Studio 2008 Debugging

 You need to add silverlight link to your Web Project. Take a look at this thread:

http://silverlight.net/forums/p/14211/47029.aspx#47029

Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sladapter

Joined on 03-05-2008
Indiana, US
Posts 403
05-11-2008 11:45 PM
Re: Visual Studio 2008 Debugging

RegularKid:
 I recently installed Visual Studio 2008 Standard Edition and the Visual Studio 2008 Silverlight Tools Add-On. However, I'm having trouble debugging. I can't put a breakpoint anywhere in code ( it becomes an empty red circle and says: "No symbols have been loaded for this document" ). It has been suggested that I go to "Start Options..." by right clicking on the web project and checking the "Silverlight" box under the Debugging section, however I don't have that check box. The only box I have is ASP.NET.
 

Hello,

This is a known-issue for VS 2008 standard user. Removing and re-adding Silverlightlink will solve your problem..  

(If this has answered your question, please click on "Mark as Answer" on this post. Thank you!)

Best Regards,
Michael Sync

Blog : http://michaelsync.net
Feed : http://michaelsync.net/feed

mchlSync

Joined on 09-16-2005
Singapore
Posts 2,021
05-12-2008 1:49 PM
Re: Visual Studio 2008 Debugging

Hmmm, removing and then re-adding my Silverlight link doesn't seem to do anything.

Maybe I'm missing a step:

1. Right click on my web project and select "Start Options..." ( noticing under the "Debuggers" section there is only a check box for "ASP.NET" )

2. Select "Silverlight Links" from the options on the left and remove the only Silverlight link I have ( proj.Silverlight.Main with a "Path in Web" as '/' )

3. Re-add the Silverlight link by selecting "Link to an existing Silverlight project in the soluction" and choosing the only one I have in the drop down list ( proj.Silverlight.Main ) keeping the "Destination Folder" as '/' and both of the check boxes under "Link Options" ticked. It asks me if I want to replace the .html test page I already have....I say "Yes".

4. I go back to the "Start Options" menu from the left column....but unfortunately there is no "Silverlight" checkbox under the "Debuggers" section :(

5. I even try doing a full re-compile and setting a break point but get the same error.

 

Maybe I'm doing something wrong in the process of re-adding the Silverlight link?

Any help would be great! Thanks!

RegularKid

Joined on 02-03-2008
Souther California
Posts 38
05-12-2008 2:00 PM
Re: Visual Studio 2008 Debugging
On your step 3 when you have Add Silverlight Link window open, check "Enable Silverlight Debugging" checkbox on that window. If you already have this checkbox checked that should be enough even you do not see Silverlight checkbox in the Web Tab. By the way what do you mean you get the same error? I thought you said you just did not hit your break point set in the Silverlight project. Set your 1st break point at App.xmal.cs Application_Startup function and see if you can hit it.

Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sladapter

Joined on 03-05-2008
Indiana, US
Posts 403
05-12-2008 2:08 PM
Re: Visual Studio 2008 Debugging

Yup, the check box for "Enable Silverlight Debuggin" is checked. I've tried unchecking it and then re-checking it just to make sure, but no luck there either. :(

RegularKid

Joined on 02-03-2008
Souther California
Posts 38
05-12-2008 2:14 PM
Re: Visual Studio 2008 Debugging
Set your 1st break point at App.xmal.cs Application_Startup function and see if you can hit it. Which page did you set your as your start page?

Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sladapter

Joined on 03-05-2008
Indiana, US
Posts 403
05-12-2008 2:25 PM
Re: Visual Studio 2008 Debugging

The application startup doesn't get hit. We have a test page that is the main .html page set as the startup page to use when debugging. And the web project is also set as the startup project.

It still won't let me put breakpoints anywhere ( saying that debug symbols haven't been created for the application yet ).

RegularKid

Joined on 02-03-2008
Souther California
Posts 38
05-12-2008 2:34 PM
Re: Visual Studio 2008 Debugging

Try to delete the ClientBin folder under your Web Project then rebuild your web project. By the way, can you see the .Xap file in that folder?

 

Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sladapter

Joined on 03-05-2008
Indiana, US
Posts 403
05-12-2008 2:41 PM
Re: Visual Studio 2008 Debugging

What is in your main.html page? Could you show the silverlight object tag in your main.html page?

 

Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sladapter

Joined on 03-05-2008
Indiana, US
Posts 403
05-12-2008 2:55 PM
Re: Visual Studio 2008 Debugging

Deleting the ClientBin and rebuilding didn't seem to do the trick either.


Here's the main .html silverlight object definition:
 

[source] 

<!-- Runtime errors from Silverlight will be displayed here.
    This will contain debugging information and should be removed or hidden when debugging is completed -->
    <div id='errorLocation' style="font-size: small;color: Gray;"></div>

    <div id="silverlightControlHost">
        <object id="slCtlHostObj" data="data:application/x-silverlight," type="application/x-silverlight-2-b1" width="100%" height="100%">
            <param name="source" value="ClientBin/proj.Silverlight.Main.xap"/>
            <param name="onerror" value="onSilverlightError" />
            <param name="background" value="Transparent" />
            <param name="windowless" value="True" />
           
           
            <a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;">
                 <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
            </a>
        </object>
        <iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>
    </div>

[/source] 

RegularKid

Joined on 02-03-2008
Souther California
Posts 38
05-12-2008 4:07 PM
Re: Visual Studio 2008 Debugging

I don't see anything wrong. Now I have no idea why you can not debug. Usually removing/re-adding silverlight link should fixed it. Is your page working at all (even you can not debug it)? Do you see the silverlight loaded on your page?

 

 

Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sladapter

Joined on 03-05-2008
Indiana, US
Posts 403
05-12-2008 4:11 PM
Re: Visual Studio 2008 Debugging

Your project build mode is "DEBUG", right?

Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sladapter

Joined on 03-05-2008
Indiana, US
Posts 403
05-12-2008 4:12 PM
Re: Visual Studio 2008 Debugging

Hmmm, ok :( Yeah, the silverlight page works correctly. The only thing that doesn't work is the debugging.

If anyone has any information on what might be happening please let me know! Any help would be greatly appreciated! Thank you!

- Bryan Perfetto

RegularKid

Joined on 02-03-2008
Souther California
Posts 38
05-12-2008 4:17 PM
Re: Visual Studio 2008 Debugging

Hehe, yup, it's on DEBUG mode with MIXED PLATFORMS.

RegularKid

Joined on 02-03-2008
Souther California
Posts 38
05-12-2008 10:29 PM
Re: Visual Studio 2008 Debugging

 Maybe I'm beating a dead horse here...but anyone have any ideas? I'm up for trying anything to be able to debug at this point :)

RegularKid

Joined on 02-03-2008
Souther California
Posts 38
05-12-2008 11:05 PM
Marked as Answer
Re: Visual Studio 2008 Debugging

RegularKid:
1. Right click on my web project and select "Start Options..." ( noticing under the "Debuggers" section there is only a check box for "ASP.NET" )
 

Yes. That's a known issue. We have discussed about this issue in this post. http://silverlight.net/forums/p/14211/47204.aspx

 

RegularKid:
Maybe I'm doing something wrong in the process of re-adding the Silverlight link?

 Yes.

  • Open your project in VS 2008
  • Open Solution Explorer
  • Right-click on your web project.
  • Find "Add Silverlight Link" or "Remove Silverlight Link"   << This is very important step. Let me know if you can't find
  • If you get "Add Silverlight Link" on content menu, please select it.
  • If you get "Remove Silverlight Link" on content menu, please select it. then, right click again. So, you will get "Add Silverlight link" this time. then, select this option.
Hope it helps.. Let me know if you are still having the problem..

 

(If this has answered your question, please click on "Mark as Answer" on this post. Thank you!)

Best Regards,
Michael Sync

Blog : http://michaelsync.net
Feed : http://michaelsync.net/feed

mchlSync

Joined on 09-16-2005
Singapore
Posts 2,021
05-12-2008 11:22 PM
Re: Visual Studio 2008 Debugging

Yes, I've tried removing and re-adding the Silverlight link from the right click menu as well as from within the property pages. Neither seems to do the trick.

The weird thing is the right click menu gives me the "Add Silverlight Link" even though it is already linked. If I click on "Add Silverlight Link" and then click "Add" in the popup that follows, I get an error saying: "The project proj.Silverlight.Web already has a Silverlight link to the selected project at destination folder of '/'. " So even though there is a Silverlight link already present, it never gives me the right click menu option of "Remove Silverlight Link". However, I CAN remove it from within the "Property Pages" popup by selecting "Silverlight Links" from the left hand menu and then selecting the project and clicking on "Remove".

RegularKid

Joined on 02-03-2008
Souther California
Posts 38
05-12-2008 11:40 PM
Marked as Answer
Re: Visual Studio 2008 Debugging

RegularKid:
However, I CAN remove it from within the "Property Pages" popup by selecting "Silverlight Links" from the left hand menu and then selecting the project and clicking on "Remove"

Yes.

RegularKid:
Neither seems to do the trick.
 

Can you try to create "new" project?

  • Then, go to "Property Pages" and remove "Silverlight links"  (There shouldn't be any error.)
  • Right-click "Add Silverlight Link" (There shouldn't be any error too. Let me know if you get the error)
  • Clean the solution.
  • Re-build the solution.
  • Set the breakpoint in Page.xaml.cs
  • Run the project with F5.
Let me know the result.

(If this has answered your question, please click on "Mark as Answer" on this post. Thank you!)

Best Regards,
Michael Sync

Blog : http://michaelsync.net
Feed : http://michaelsync.net/feed

mchlSync

Joined on 09-16-2005
Singapore
Posts 2,021
05-13-2008 12:01 AM
Re: Visual Studio 2008 Debugging

Yes, that works!

I was then able to get my project debugging correctly. I feel really stupid now, here's what I was doing wrong: When you first startup the project your breakpoints become empty circles for a few seconds before they "re-enable" ( guess I'm used to standard windows applications where that doesn't happen ). I was simply getting frusturated and killing the project as soon as I saw that they became empty circles. After that I focused to much on there not being a "Silverlight" check box under the "Debuggers" section of the property pages without simply trying more breakpoints and seeing if they hit.

Thank you, thank you, thank you! Sorry to take peoples time on this! Much appreciated!

RegularKid

Joined on 02-03-2008
Souther California
Posts 38
05-13-2008 12:09 AM
Re: Visual Studio 2008 Debugging

RegularKid:
Yes, that works!
 

Good. :) I'm glad to hear that your problem is solved. :)  

(If this has answered your question, please click on "Mark as Answer" on this post. Thank you!)

Best Regards,
Michael Sync

Blog : http://michaelsync.net
Feed : http://michaelsync.net/feed

mchlSync

Joined on 09-16-2005
Singapore
Posts 2,021