Visual Studio says it can't find source code for a web-debug - visual-studio

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.

Related

Recurrent message "Cannot navigate to the symbol under the caret"

I'm using Visual Studio 2015 CE. About a week ago I started seeing a message box showing the error mentioned in the subject. It happens only if I try to open a .cs file and it's completely preventing me from working :(.
I also noticed that the projects in my solution are being "lazy loaded". That means that I open the solution and in the solution explorer I see my projects listed with a label that reads "(loading)". Once I click on them, they get loaded.
I think it could be due to a windows update, probably, because I also noticed that while working with the browser (Chrome or Edge) F12 seems to be automatically pressed because the developer tools are opened randomly. That kind of makes a consistent pattern with the issue in VS. I uninstalled the latest updates but still have the issue.
Now, I don't thing there's something wrong with my keybord, even that's possible.
I saw many posting about this issue but couldn't find a solution yet.
Does anybody know what could be wrong here? I'm about to completely reinstall my computer.
Thanks!
Gonzalo

Unable to set breakpoints in Chrome dev tools, version 26.0.1410.64 m

I need to debug some JavaScript an' I use Chrome dev tools. I'm a newby in JavaScript (just started to learn a couple of days ago), an' at work I could set breakpoints via the Resources pane. But at home for some reason I can't do this: after the click no breakpoint appeares.
I have Chrome version: 26.0.1410.64 m.
What could be the case?
clicking on the De-Obfuscate Source button (i.e. {}) solved this issue for me.
I'm a fool! haha! breakpoints are set in the Source pane )))
It's been a while, but in version 33.0.1750.146, but my problem was that I was on the Sources pane (I'd call this a tab; it's one of the items at the very top of the window), but I was on the Content scripts tab (on the left hand side). I needed to switch to the Sources tab.
To be clear, there are two sets of Sources tabs; one is within the other.
UPDATE 2016-01-07: Now I'm on 47.0.2526.106. The only thing that worked for me today was to close DevTools and re-open. It was a little finicky. It worked once, then stopped, and I had to close the DevTools and re-open again. I saw #johntrepreneur's answer about closing the browser, but unfortunately I have too many tabs open on too many workspaces, so that's too much of a pain, so I didn't try that, although I have to assume that would work.
Other solutions didn't work for me. Had to close and restart browser to be able to set breakpoints again.
This also happens when there is a JS error in your code.
Some sort of weird built in function in windows 10 i think because I did press a few buttons by accident. Some of my keys even stopped working in certain areas of visual studio. F.e the letter "c" stopped working in the find window.
Mine did this and no solution worked, i pressed alt, windows key and function key a few times and my problem went away.
Fixed as follows: For me, the issue stems from having set up Chrome to interact with operating system files. If you set this up, then the fact is evident from a green dot by the file name. At some point, I could not set a breakpoint in a recently edited file. I fixed this by disconnecting the interaction, as follows: When viewing "sources", above the code, there were some file names listed. Clicking the [x] to make the particular filename go away gave a caution message; I proceeded without saving. After that, I was able to set breakpoints for that file.
I also had this problem. However, once I closed the popup message in my browser, suddenly all my breakpoints that I set in that time appeared. Mental note: Don't set breakpoints while your app is showing a popup.
I couldn't find any direct fix for this problem.
It seems that chrome keeps settings of your site stored somewhere whatever you do to clean it. (I tried removing the folder from workspace, closing et reopening chrome etc... and nothing worked).
A workaround is to change your site's url to make chrome consider it a new site

Visual Studio "Multiple Startup Projects" Problem

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.

Error List Freaking Out in VS 2008 while in large Aspx Files

I've been having this irritating issue lately. The site I'm currently working on has large aspx pages with tons of client side js code. While I'm typing the Error List window will keep opening and closing at the bottom of VS (where I have the window docked). I mean constantly. This is beyond aggravating as you can imagine. It's happening to a coworker as well. Does anybody else have this issue? Any solutions? (other than smaller pages)
We've got 2008 Pro SP1. I've turned off every JS feature I can find since with pages this large it slows the VS to a crawl while it tries to parse it. I've tried closing the Error list completely but it just re-opens itself.
Thanks in advance,
Geoff
Try deleting the .user file in the project directory
Use Add/Remove programs to do a repair on VS2008
If neither of those work, copy the markup to a new project and attempt to reproduce. If you can reproduce this issue then update this question with details.
I finally found the options that were causing the issue.
1. Options->Text Editor-> Miscellaneous,
un-check "Formal HTML on paste
2. Options->Text Editor->JScript->Formatting
un-check The boxes under "Automatic Formatting"

Debugging asp.net with firefox and visual studio.net - very slow compared to IE

Debugging asp.net websites/web projects in visual studio.net 2005 with Firefox is loads slower
than using IE.
I've read something somewhere that there is a way of fixing this but i can't for the life of me find it again.
Does anyone know what i'm on about and can point me in the right direction please?
Cheers
John
edit
sorry rob i haven't explained myself very well(again). I prefer Firefox for debugging (firebug etc)
hitting F5 when debugging with IE the browser launches really quickly and clicking around my web application is almost instant and when a breakpont is hit i get to my code straight away with no delays.
hitting F5 when debugging with FireFox the browser launches really slowly (ok i have plugins that slow FF loading) but clicking around my web application is really really slow and when a breakpoint is hit it takes ages to break into code.
i swear i've read something somewhere that there is a setting in Firefox (about:config maybe?) that when changed to some magic setting sorts all this out.
bingo. found the article i read before.
i just changed my network.dns.ipv4OnlyDomains property in about:config to localhost. restarted firefox and now firefox performs the same as IE when debugging asp.net with visual studio (2005).
hope this helps anyone else that has the same problem.
"Alternative solution". Do the following in Firefox
about:config in the address bar
set network.dns.disableIPv6 to true.
Are you serious? One of the main reasons I stick to Firefox is because its so much nicer to develop with..
The live source update is awesome (view source > change code > rebuild > F5 in source)...
What is actually "slow".. I mean, the some browsers tend to be slower at rendering, but I dont see how it affects your debug time? As soon as the request is made, and your breakpoint is hit in the code, it stops?
For quick debugging try this..
Add Debugger.Break() into your code at an appropriate place.
Browse to the page in firefox (via localhost) if on local dev machine? and the Visual Studio Just in Time debugger should pop up.. select the currently open instance of Visual Studio and you can step into the code where every you want without having to start from the beginning or jumping to cursor.
-- Lee

Resources