I cannot figure out how to get my breakpoints to take in my silverlight application. I've tried setting up a test page, but nothing seems to work.
Here are some of the things I've tried:
Enable Silverlight Debugging: In my Web project, I've set the 'Web' => 'Debuggers' => 'Silverlight' to checked.
Attach to Process: I'm using Chrome, but the page I need to attach my debugger to is disabled in my 'Attach to Process' window.
Using Firefox: I followed Tim Heuer's post where he describes turning off npctrl in the about:config page.
I've tried many other things as well over the last few hours, but nothing is working. I fear that I'm missing something.
UPDATE: October 20, 2011
Fixed the problem and posted my answer below.
Fixed! I fixed the problem by removing all auto generated files (*.user, *.suo, /bin, and /obj). What a nightmare of a bug this has been. Here was everything I checked:
Ensured my ASP.NET MVC application had 'Silverlight Debugging'
checked. Did this by navigating to my Web project's Property Page =>
Web Tab => {Scroll to bottom} => Check 'Silverlight'
Set my default browser to Internet Explorer. Did this by right
clicking on my TestPage.aspx in my web project => Browse with... =>
Internet Explorer (not sure if this was needed but I did do this, so..)
Cleared my Web Cache from Internet Explorer. Did this by opening IE => [Tools => Options...] => [General Tab] => [Browsing History Group] => Delete History button!
Removed all my auto-generated files from Visual Studio. Did this by manually finding all *.csproj.user files, *.suo file, and all "/obj" and "/bin" folders.
Cross my fingers! (Important step!)
Open my project... set a break point in my Silverlight code... clicked Run!
To my surprise it all began working. I rejoiced. :) Ultimately it was due to my auto generated files, because I did the first 5 steps over and over and over, to no avail. I do believe that each step played a key role in getting me to debug my application again, but the last step was the kicker for me.
At one point during this "adventure", I went so far as to reinstall VS2010, VS2010 SP1, Resharper 6, Silverlight 4 Developer Tools, etc, etc... Basically, my full dev environment. This was because I thought I had an invalid version of Silverlight 4 on my machine. Upon trying to "Repair" the Silverlight 4 Developer Tools, the install told me that Visual Studio 2010 wasn't properly installed... hence the derailing path... Ugh!! Many hours were lost trying to debug my Silverlight application. However, all is good with the world now.
I hope my post helps somebody!
Related
I have accidentally made a setting change to VS2019 and I can't get back to how it was.I was debugging a Azure Functions project with out any problems. I was trying to set up the project to use XUnit to test the functions and set the appropriate start-up projects. I couldn't get the azure functions project to hit debug breakpoints. In the end I gave up and decided to use two instances of VS2019 but now I can't hit any breakpoints int the Azure Function app. I also noticed the command prompt window which starts when you run the app doesn't shut down when you click stop in visual studio. I saw a SO question saying to check:
Use Managed Compatibility Mode.//should be Unchecked
And unchecked which it is.
Any ideas on what setting is incorrect?
TLDR: Uncheck the "Automatically close..." option in the image below.
I have encountered the same problem with Azure Function projects, and found a solution to this. Symptoms:
Breakpoints are not being hit (silently ignored by VS)
Adding a breakpoint during debug gives a white breakpoint and "Breakpoint wont be hit..." message
The reason for this is that modules are not being loaded. This can be confirmed by opening the "Modules" window in VS during debugging (ctrl+alt+U, or search for it in top right). This window was empty for me (but filled with references if i was debugging a console application for example).
To get module loading to work, i had to uncheck the debugging-option "Automatically close the console when debugging stops". And suddenly my modules-window was filled during debugging, and breakpoints working.
For me, somehow my own project had been added to the exclude list in Debug => Options => Debugging => Symbols => Specify Excluded Modules
This may be the wrong community to ask in (maybe SuperUser?) however I am experiencing a bug with VS. It is very minor but I was curious to see if anyone has seen this before or knows how to fix it.
I have run my project to debug and then upon exiting the application i.e. Application.Current.Shutdown() and Environment.Exit(0) the button at the top, that would usually return to saying start and being enabled, remains disabled and reads "continue".
All of the other methods of debugging the project are still available (Debug Menu / f5), however, it is still a conundrum nonetheless. Please respond if you have seen this before and/or you are aware of a fix.
Please see the image below.
EDIT: Further Information; (any further information that is requested will be added here)
My application is C# and was started as a WPF Application.
EDIT: Bounty timing out - Just a note, I have updated to latest versions of VS and the basic extensions and I am still experiencing the problem.
You can try Application.Exit(); instead of Application.Current.Shutdown()
if still happens, you can try to kill the VS first in the task manager. Then reopen the project.
This one also, you can try to visit this link as my referral.
How to use Application.Exit Event in WPF?
Try this:
Go to Project's Properties > Web Tab > Check Enable Edit and Continue
With “Enable Edit and Continue” on, the VS debugger starts your web application in IIS Express. When you stop debugging, IIS Express is closed too. With this behavior, you will see the IIS Express system tray shows up during debugging and gone after debugging.
Been using Visual Studio Express 2012 Web for a few weeks now learning JavaScript, HTML5 and CSS for a web based application. As a .NET developer its great to have the familiarity of VS (although better JS/HTML intellisense would be nice) and my progress is good, however there is an annoying VS quirk during debugging that I can't resolve. Occasionally VS (or perhaps more specifically IE10) will stop recognizing any code changes and run the previous version of the code. This is annoying but I can get around it by hitting an extra F5 when IE10 launches but it shouldn't be needed. I assume the file cache for IIS express is not being refreshed when the source is updated but I could be wrong. After a while of experiencing this problem I have not been able to pick up a pattern to understand what usage pattern causes the problem.
Has anyone else seen this? Any fixes? Searching the net draws a blank.
I use VS web site project types and have a vanilla installation of VS 2012 express (uses IIS express) on Windows 8 and debugging with IE10.
Thanks.
Has any web developer using visual studio web found a way around this? I found Chrome to be more reliable at ensuring the cache is refreshed when the code changes however with the IE & VS integration its easier to develop with IE.
This must be a common problem? I have tried IIS Express as well and the same issue (figures as I'm sure its a problem with the browser cache). Typically the problem occurs when running IE for the first time, and if there is a bug in my Javascript code that breaks the execution before the screen is painted its quite a pain as its not as easy to clear the cache manually. The only workaround I have is use F12 and 'clear browser cache for this domain' then F5 to refresh. Workable but annoying.
Any tips to resolve this would be appreciated
Add this:
window.applicationCache.addEventListener('updateready', function (e)
{
if (window.applicationCache.status == window.applicationCache.UPDATEREADY)
{
window.applicationCache.swapCache();
if (confirm('A new version of this site is available. Load it?'))
window.location.reload();
}
}, false);
I found this solution somwhere in the Net. Sorry, but I don't remember the author. It works for me when I debug Web App with JavaScript in Visual Studio 2012 using IE.
Please, stop cursing Microsoft. We all use their pruducts, be fair.
I don't work at Microsoft but I would be unhappy without its products. I think all of us would.
I am using Chrome myself, but still experienced the same problem. In the end I settled on the solution of completely turning caching OFF on my local WebServer - being VS's IIS Express -. This can be done by adding a UseMaxAge of 0 to the web.config. As follows:
XML
<configuration>
...
<system.webServer>
...
<staticContent>
...
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="0.00:00:00" />
</staticContent>
</system.webServer>
</configuration>
Notes
This works in regular/full IIS as well.
Be sure NOT to deploy this setting to PRODUCTION. Use a production specific web.config there to allow end users to harness some caching :). Otherwise this could be a performance killer.
Using CTRL+F5 instead of just F5 SHOULD also refresh it, however that somehow did not work either Chrome v39.0.2171.71 m). I found out it DID work to directly open the cached Javascript URL in the same browser (!) tab, press Ctrl+F5 on that and then return to the (HTML) page and use CTRL+F5 there again.
Another option that sometimes works is to restart IIS Express (Taskbar right click and choose 'Exit' from context menu). But that is also pretty cumbersome.. :)
I'm using VS2005, and have been for many years without problems, and 2003 before that.
Today suddenly, when I try and debug javascript on a site from the web, the debugger loads as normal but complains it can't find the source and offers me the chance to go looking for it. In the Script Explorer it shows all of the files loaded by the page, it just won't show me the source for them when I double-click on them.
I've tried resetting all settings to web-development default. Didn't work. I even tried exporting the settings from another machine (XP) I have with VS2005 on it that works fine. After importing to the faulty machine (on Win 7) it made no difference.
Any ideas?
Steps to recreate:
1. Open IE9, go to yahoo.com
2. Click View->External Script Debugger->Open
3. Once in the debugger it says cannot find source and offers me a dialog to help me find it on my local machine (why would it be there?).
4. In the Script Explorer I see all html and js files the page loaded, but upon double-clicking them, nothing happens. Usually it opens the source and you can set breakpoints.
Working config is on XP/IE8
Non-working config is on Win 7/IE9 but was working fine before today.
I just noticed a bizarre side-effect. The File menu in IE9 is greyed out during the debug session and even after I've closed VS. So freaky.
Well, no solution was found as to why VS2005 suddenly developed a lack of understanding as to how to get JavaScript source code for live sites. I uninstalled it and installed VS2010 instead and that's working just fine, on the same sites. Maybe re-installing VS2005 would have worked, but I'd had VS2010 around waiting to be installed for a while anyway, so two birds, one stone and all that.
It remains a mystery. No point anyone offering any further input now. The problem is history.
Background: I have a Visual Studio 2008 solution containing three different web application projects. If I right click on the solution, choose "Set Startup Projects.." and then choose "Multiple Startup Projects", I am able to fire them all up at once when I hit F5 (Start Debugging).
Desired Behavior: What used to happen (until it unexpectedly stopped working) was that it would automatically open up three browser instances (IE by default) and run each of the web apps in each of the three browser windows.
Current (Undesired) Behavior: All of a sudden, instead of opening three browser windows, it now opens a single browser instance and sequentially starts them all up with the exact same window/tab, which means that I am left with only one app actually running. (Whatever the last app it was that got started.)
Any idea what could cause this? I've checked my project and browser settings (including the "Reuse windows when launching shortcuts" option) and can't seem to figure it out. Any ideas?
Update: I changed Visual Studio's default browser to Firefox, and it works as expected by opening up multiple browser windows. I guess I'll just use Firefox when debugging for now, which is probably a good thing anyway.
I don't know why it had stopped working but rather have a suggestion: Check 'Don't open a page. Wait for a request from an external application.' option under 'Start Options' page of your Web project property pages. It specifies that Visual Studio won't open the browser window automatically. It should start your project in a Web server and wait for another application to make a request.
This seems to be a bug/feature in newer instances of MSVS and/or IE.
It happens in Visual Studio 2013 and 2015 as well, and might not be a bug as such, but can certainly be an undesired behaviour.
To reproduce:
Select 2 web projects in multiple startup projects.
Set one to Startup and the other to Start without debugging.
Only one browser tab is used, but you will see the tab used briefly by each project before the next one is loaded.
The problem is that the last loaded project is not necessarily the project you want to have in the browser.
An other workaround is to simply set both projects to Start.
It turns out using Firefox did the trick for me. Since there are no other answers, I will just accept this one.