Debugging Silverlight Applications - silverlight

As hard as I try, I cannot get my silverlight app to stop on break points. I've tried both in and out of browser debugging.
Steps I've done:
Repeatedly cleared my internet
cache.
Made sure Silverlight
debugging is enabled in my test web
application.
Made sure symbols are
loaded by placing a reference to the
silverlight app in my test web
application. (I had the hollow red
dot problem, but this fixed it)
Restarted visual studio and the ASP.NET Development Server
Made sure I was attached to the right process by manually attaching to either sllauncher or the browser hosting the silverlight app.
Ensured that the xap file is being updated in the ClientBin directory after rebuilds.
Cleaned and Rebuilt the solution multiple times.
From my searches, I've found that debugging issues are usually caused by one of the above, but nothing seems to work. It looks like I'm debugging, but the application never breaks. Anyone have any experience with this?

Check the properties of the Web Application / Site. In Visual Studio, Right Click --> Properties. Click the 'Web' tab on the lower left. On the bottom under the 'Debuggers' section, ensure that Silverlight is Checked.

Are you use IE for application or other browser? Be sure that you use an IE.

Related

All converted apps including samples fail to run with a 'The parameter is incorrect'

I'm trying to convert a WPF oneclick installed application and so everything should be pretty straight forward. However, whenever I run the debug project, I get
'The parameter is incorrect'
in a message box popup and I can never run the app.
This happens for my app while trying to debug, all the samples from github, and even the DAC application from the Windows Store. The error pops up even once the app is installed and showing in my application list.
I'm on the latest build of the Creators Update.
There are various errors in the event viewers, but they seem to be a common occurence for WinRT apps.
Any ideas at all?
If you have the WPF project in VS2017, I'd recommend to package directly from VS without using the DAC. see the article for more information https://learn.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-packaging-dot-net
The problem appears to be related to the May Security Update. I restored Windows to the factory defaults and everything works fine.
However, once I install the the May Security Update to address this bug with Sql Server and Filestreams, the Desktop Bridge Debugging project stops working.
I'm going to throw out a random guess that it's related to the Microsoft Malicious Software Removal Tool, as the event viewer logs mentioned an issue with the 'parameter is incorrect' referring to the Microsoft.MRT.
Of course it could be anything, and as only 7500 people have even downloaded the Desktop Bridge Debugging project in the first place, I doubt it's high on the list of Microsoft Developer Priorities.
And to be completely honest, it's really probably my fault for not rewriting the app as a UWP app, after rewriting it as a Windows Forms app, and as a Silverlight app, and as a WPF app and on and on and on. Although, I'm not sure how many glasses of Kool Aid are left in the punch bowl for me.

SIlverlight XAP file not refreshing when debugging application

I work on a team building Silverlight apps (version 4). We use SVN and all work on separate parts of the code, and regularly update the project with latest code. The Silverlight app runs from an ASP.NET web app. We are having very frustrating issues when updating our code. It seems like old versions of the XAP are being cached.
Example: Francisco changes the wording of a popup dialog, and commits his changes. A very simple change, what could possibly go wrong? I get the latest code. I see the new code in my IDE (VS2010), and run it. When I view that dialog, it does not have the new wording, even though I can see the new wording in my files. I put a breakpoint on the code right where the change is, but when I run the app, the breakpoint is disabled!
I try Clean build of the Silverlight and the Web host. I kill my local ASP.NET development server. I run the app - same thing! I delete the xap from ClientBin. No good.
Each of us on the team are experiencing this issue. Now we occasionally solve it, but are never sure what exactly fixed things, which is not satisfactory.
There must be some setting or something that we are missing. You would think that deleting the ClientBin xap file would solve it, as the new XAP must come from compiling the Silverlight app, right?
If you've seen this problem before and have a real solution, please let me know. (The solution of "format your hard drive and re-install everything" will NOT be accepted!)
Thank you,
Daniel Wiliams
I recommend that you use IE for Silverlight development. See also this answer.
The problem with using Firefox for development is that Firefox runs plugins in a separate process (plugin-container.exe). When launching the debugger, VS doesn't know that Silverlight won't be running from the process it launched, so it doesn't attach to the correct process. The breakpoints in Silverlight code appear not to work because the VS debugger hasn't attached to any process running the Silverlight code.
I believe it's possible to disable the use of the plugin-container.exe process (see, for example, LIMPET235's post here), but that won't fix the apparent caching you're also experiencing.
I used to use Firefox for Silverlight development, but I found that things worked much more smoothly when I switched to using IE.
First of all, could you please check is your .xap file also included into source control?
it should not be included..., no need IMHO.
Most likely your xap file is set to read only.
go to that file location and make ClientBin folder not read only if is.
I've seen this before the XAP file is cached. Try emptying your browsers cache and then putting a query string on the XAP. So your XAP reference would look something like Foo.xap?1234
couple things to check.
Make sure your silverlight project's output path is correct.
Make sure your silverlight application has been added to your web app project.
Enable silverlight debugging in your web app project.
Set the silverlight project as a dependency in your web application's settings
The solution of "format your hard drive and re-install everything" will NOT be accepted!
Format your hard drive and install Linux (:
More to the point, configure the Silverlight Applications tab in the SomeSilverlightApp.Web project to copy the xap file from the SomeSilverlightApp project to the ClientBin folder which shows there by default.
The ClientBin folder is also part of the SomeSilverlightApp.Web project in my case and the xap properties are set to CopyToOutputDirectory: Always so that it also gets deployed.
This is probably not the right solution but it works here and I have not time to try to investigate this weird logic.

Debugging silverlight application problem

My VS2010 doesn't stop at breakpoints inside of silverlight application. It appears that no symbols for it have been loaded during debugging. When I hover over the break point it says "The braekpoint will not currently be hit, no symbols have been loaded".
I have tried all of possible solutions offered by google and have no success. The problem occurs even when I create brand new silverlight app hosted by an ASP .NET web project. All of my project configuration looks fine - silverlight debugging is enabled in the Web project.
I am using silverlight 4.
here a link to the sample project created out from the tepmlate.
Any thoughts ?
P.S I just tried to reinstall VS2010 and the problem still exists.
EDIT: I just tested the same project on another machine and it stops at the break point it seams that the problem is somewhere in the configuration of VS or silverlight.
with Matt Dotson's help I managed to attach the debugger manually. However this solution is not good enough for daily use.
Depending on my experience in Silverlight following these steps keep your project debug-gable.
Condition 1>
Firstly we need to be ensure that in Web Project's properties there is a Web section, as you see below Silverlight checkbox must be checked.
Condition 2>
Follow In Menu Debug => Attach Debugger>
Visual Studio sometimes can't attach debugging platform you need to lead the way :) . By this way you may debug other platforms,(also you may debug your product platform but pdb files must be sync and don't forget you may suspend your product platform using this).
Condition 3> Your default web browser may be Firefox,Chrome or other than IE.By Visual Studio default try to attach to IE. But when you run VS calls default browser,so you need to have a manual attachment in Condition 2 or set your default browser by right clicking on default page > Browse with .
Condition 4> There is xap file generally located in web project\ClientBin directory. Sometimes after build operations this file can't be replaced and your ProjectDll and your Project PDB files not be sync. This cause wrong line match while debugging or can't find a debugging file attached caution. I strongly suggest delete all generated files in Bus project and delete Clientbin\ProjectName.xap file. After rebuild all it must be ok!
Hope helps.
What broswer are you using? You need to be using Internet Explorer to debug silverlight projects.
I have had a similar frustrating experience with this but in my case the solution was very simple. It seems that somehow, and I really have no idea how, the debugger option for Silverlight had become unchecked in the properties on the hosting ASP.NET project.
I just assumed that as I had been previously debugging, this option was set and I didn't bother to make sure that this was this case. Just goes to show that one should always check the basics first; if I had done that it would have saved me some time.
To check this in VS2010, right-click on the project and select properties, change to the Web tab and check the Silverlight option at the bottom of the page, in the debuggers section.
Also see the debugger to a silverlight process
http://msdn.microsoft.com/en-us/library/cc838267(VS.95).aspx
If that doesn't work, then
reset iis (if you are debugging in that)
delete temporary asp.net files (%SystemRoot%\Microsoft.NET\Framework\versionNumber\Temporary ASP.NET Files)
clean and rebuild your solution
The resolution came after 2 days of headbanging. It appears that the link which Malcolm gave covers exactly my problem but my I was narrow-minded enough not to pay it enough attention because when I run the debugger as long with the app my default browser was FF. So I thought that after the FF starts I can load the page from IE or Chrome.
Actually the problem is that the debugger cannot be attached to the silverlight project because of the FF. And when I load the app from IE or Chrome the debugger dis still not attached.
Thanks to everyone that tried to help.
if you have multiple project, Rebuild the project separately that you want break point. Its work for me
Try also picking internet explorer from browser list menu as your browser

Symbols not loading for Silverlight app on VS 2010

Hi I have a silverlight application pointing to Silverlight 3. I use VS 2010 Ultimate. When i run it in debug mode or attach to process, break points will be highlighted with yellow exclamations saying symbols are not loaded. I tried the solution given here: http://social.msdn.microsoft.com/Forums/en/vsdebug/thread/7bf5a77b-c30d-4674-a8fc-c8fe46ce676b
It points to a pdb file on Framework's temp folder and says Symbols loaded. I tried to load the symbols manually by going to Symbol Settings. Even that did not help. Any idea how to fix?
Another step to take when Silverlight debugging doesn't work is to clear the cache of the browser.
Also make sure the properties in the web project hosting silverlight has silverlight debugger enabled. Web -> Debuggers -> Silverlight checked.
What worked for me:
Remove the Silverlight project from my Web project
Clear the Browser Cache for IE
Go to the folder where IE stores its cache and delete Silverlight*.js
Add the Silverlight project reference back to my Web project
Rebuild and start debugging
I don't know why this works but this is how i got it working.
I went to Tools> options> debugging
unchecked "Require source files to exactly match the original version"
Mostly it happens due to mismatched version of Silverlight and SDK. Uninstall both, and install it. I hope that helps.
You can try starting a new instance.
Right click to Web Project, select Debug, Start a new Instance.

How to debug Silverlight against Google Chrome

Does anyone know how to debug a Silverlight 2 app running in Google Chrome from Visual Studio? Even after making sure that Chrome is the debugging browser, breakpoints are still not being hit.
Have you tried attaching to Chrome manually? Tools > Attach to process?
Chrome isn't officially supported but there are hacks.
Here for example. Halo's comment may give you some help too.
You can have more than one browser running on your localhost.
1) Hit F5 to run debug. Probably opens IE or whatever your default is. F5 your way through the breakpoints until it's loaded. Leave this IE open.
2) Open your other browser, coping the localhost Url into the new browser and run it. New browser should hit the breakpoints.
This works with all browsers, and even emulators like BlackBerry emulators.
Attach to the process manually (Tools > Attach to process), but make sure to attach to the chrome process that lists its type as "Silverlight, ...". Its title should be blank.
If you see your application name in the title, it's because chrome has a separate process for the HTML form that your Silverlight app is in, and the html's title probably matches. Attaching to this process does not load the Silverlight assemblies.
I usually will start debugging the app in IE to make sure that the most recent changes are compiled and running, then launch chrome, clear its cache ('cause it likes to hang onto Silverlight data), paste in the url from IE, and then stop IE and attach to chrome. Extra steps, but worth not spending 3 hours to figure out you are looking at cached assemblies.
This is an issue with Visual Studio interacting with Chrome: http://code.google.com/p/chromium/issues/detail?id=45560. My guess is you need to wait for a Visual Studio patch, but I honestly wouldn't hold your breath. The majority of Silverlight developers just use IE or FF for debugging. (Apparently even FF has some issues now that they've sandboxed their plugins: http://timheuer.com/blog/archive/2010/08/16/enable-silverlight-debugging-in-firefox-visual-studio.aspx#20476). As much as I hate IE, it's really your best bet for debugging Silverlight apps.
Simply set SL app as startup prtoject instead of asp.net and press F5

Resources