Silverlight Web Project shows install icon when debugging - silverlight

When I add a Silverlight project to a blank solution, it asks me whether I want to add a web project to host the silverlight page or automatically generate a test page. Oddly enough, when I automatically generate a test page, everything in fine. However, when I add the web project I have problems.
I first get an error saying that it needs System.Web.Silverlight.dll in the bin folder of the web, so I do this. Then when I run it, all I get is the “Install Silverlight” icon. I’ve tried playing with and/or removing the minimum version tag and the version tag, but I just can’t seem to get it to work that way.
Has anyone had this problem before? If so, how did you get around it?

Sounds like you've got an old toolkit installed or the project template is corrupt.
Try a re-install the lattest Silverlight Tools for Visual Studio

To get rid of the first error, go to your references in your web project, and go to the properties for System.Web.Silverlight and go to its properties. Make CopyLocal true.
To get rid of the install icon problem, go to the Silverlight control markup in your aspx page and remove the MinimumVersion attribute. This doesn't seem like te most ideal solution, but at least one can debug.

Related

Silverlight 4 OOB White Screen of Death. Failed to load pre-requisites for the application

I'm developing a SL4 OOB application that has suddenly started giving me the white screen of death.
If I try to run it 'in-browser' and check the console I can see the error 2105 : 'Failed to load pre-requisites for the application' but there's very little info about it anywhere.
None of my breakpoints get hit. Even starting the app with F11 (step into) doesn't get me anywhere.
I can run other Silverlight projects just fine so it's not the runtime. I've even copied the source into another project to see if that might help but to no avail.
Does anyone have any ideas how I might get started fixing this?
I have seen this myself and it was a pain..
What I had to do was a system restore, de-installed all traces of Silverlight and Blend and then reinstalled them all. However I had also just installed Silverlight 5 RC which didn't play nicely with Telerik and might have been the problem.
There is also some information about this error here:
http://connect.microsoft.com/VisualStudio/feedback/details/530074/unhandled-error-in-silverlight-application-2105-when-building-as-an-x86-configuration.
Is this your problem?
Damn it, I hate answering my own questions but the problem was quite obscure.
Somehow, I managed to get a regular .Net reference in my Silverlight project through a Nuget package. That was it.
DOH!

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.

Debugging Silverlight Applications

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.

Resources