visual studio attach to process not working - asp.net

I am trying to debug my production website using the code on my local system.
I am using VS2010, and tried all sorts of things still didn't work.
I tried using VS Development Server, and tried using IIS still didn't work.
When I attach the process debugger starts but break points were not hitting.
I tried attaching process to W3wp process, and tried attaching it to IE also.
Still its not hitting break points. Any idea whats causing this.
Thanks

What you want to do is called "Remote Debugging".
Here is an MSDN link to get you started: MSDN

Try clearing the settings of Visual Studio
Tools->Import and Export Settings Wizard->Reset all settings->No…->next and set it
One more option, which worked for me is to open the VS in Safe Mode. It will 100% work:
Open Windows Explorer, and navigate to \Common7\IDE;
Devenv /SafeMode: Launches the IDE in safe mode loading minimal windows.

Related

visual studio debug error unable to start program no more files

System info: Win 7 x64 SP 1, IE 10, Visual Studio 2010
I've been researching this error all over.
visual studio debug error:
"unable to start program (File path) no more files"
This started with the installation of internet explorer 10 and is happening across all my web projects within Visual Studio 2010.
I've tried all possible solutions (but not VS re-installs) from registry entries (http://forums.asp.net/t/1891930.aspx/1), IE 10 reinstall (fail...won't let me reinstall due to existing version) to switching default launch browser (in Visual Studio, select a different browser such as Chrome to be default browser in "Browse With..." option in project..it works but is pain in the rear) but one thing I just tried which is making me wonder if there is an issue with how IE 10 is launched came from the following experiment:
Basically I did the same process of changing the default browser except that I picked IE 10 x86 version manually in the "Browse With..." option, set it as default and ran project. Voila, it works with no issues.
My next step was to confirm the default IE option in the "Browse With...". I found articles such as (http://lennybacon.com/post/2010/08/22/rehowtochangethedefaultbrowserinvisualstudioprogrammatically) which put me on the path to find out where the settings are for Visual Studios default browser settings.
I checked the browser.xml file and all looked ok including the registry entry pointing to it. I'm unable to check the version of the browser since MS, in it's infinite wisdom decided not to show that info in the Help -> About or anywhere else. so my gut feeling is that the default IE 10 being launched is the x64 bit version.
Does anyone know?
1) how I can confirm the default version of IE 10 launched since afore methods have not worked and
2) why would (I'm assuming) IE 10 x64 launch vs. the defined IE 10 x86 referenced version in the browser.xml file?
Thanks for any and all help.
Dave
UPDATE:
So from doing continual testing, it seems that after I ran the process to change the Default Browser settings in both the registry and the browser.xml file, upon launching the debug process in Visual Studio 2010, it automatically reverted back to the original default broswer settings which would launch the x64 version of IE 10. So in my case, it seems that the issue (error above) lies in the fact that debugging in Visual Studio 2010 using x64 browsers would cause the error. With no recourse, I ended up removing IE 10 from Windows Features and going through a painful process of getting IE 9 back on my system, I now can effectively debug using IE (x86).
It seems that MS is not pursuing any fixes for this issue of the default browser in VS 2010 from what I've read. There are in browser tools I've seen to do the default browser setting changes but don't want to bother with it/don't trust it will work.
Hopfully this helps others dealing with the same pain I have endured...
Thanks
Dave
When I ran into this problem (using IE 11) I noticed that iexplore was open about a hundred times in the task manager. After killing them all I was able to open my project just fine.
Since then, I have made a .bat file with this code: taskkill /F /IM iexplore.exe /T
so now I just run the .bat when I get that error. (alternatively you could run that code from the cmd)
James Butler's response is good for killing all the open IE processes. Which seems to be the issue here. The best solution I have been using is to just set, "Don't open a page. Wait for a request from an external application." then I just refresh the URL (if already open in browser) each time I rerun the debugger.
Access in Project properties under the, "Web" option. Then change setting there.
Check the following registry key
HKLM\SOFTWARE\Microsoft\Internet Explorer\Main\TabProcGrowth
Make sure that the value is Minimum
I started getting this error today after restarting from a Windows Update. I'm on Windows 8.1 desktop using VS.NET 2013. To fix I had to add another browser choice in VS debug that was pointing to the x86 version of IE11, and set that as the default. Although the post alludes to the x64 vs x86 browsers being the issue, this seems like an easier solution than the original poster's process of uninstalling and reinstalling browsers.
This blog explains how to set the default browser for debugging to IE x86: http://weblogs.asp.net/gurusarkar/visual-studio-web-developer-express-starting-two-instances-of-internet-explorer-and-throwing-an-error
Have you tried this: "...try selecting the project node in Solution Explorer and choose Set as StartUp Project". Just worked for me.
https://social.msdn.microsoft.com/Forums/en-US/efd93f22-1f1f-4fb1-8ff3-e29104780572/unable-to-start-program-there-are-no-more-files?forum=lightswitchgeneral
I think this is caused by a more general issue of low available system memory. In my case, Performance Monitor showed I was using 82% of my available memory when I was receiving the error. Looking at the processes, the culprit for me was lots of Chrome processes. I shut down Chrome, which freed up about 2 GB of memory, and then I was able to run the debugger successfully. Shutting down lots of IE processes would achieve the same thing of freeing up lots of memory. So I think the solution is just to free up system memory by shutting down whatever processes you don't need open.
This is what is working for me with windows 11 and edge:
Project Start Options - Don't open a page. Wait for a request from an
external application.
Start - Local IIS (Microsoft Edge)/Script
debugging disabled
Create a shortcut to launch the application like
this: "C:\Program Files (x86)\Internet Explorer\iexplore.exe"
http://localhost/MyApplication/

Visual Studio 2010 giving error "External Component has thrown an exception"

I am running Visual Studio Ultimate on Windows 7. Here is the description of my problem:
My VS 2010 had been running absolutely fine until today when it started giving error "External Component has thrown an exception" when I try to open a new website. Creating a new web application works fine though but I am unable to run any of them.
While trying to run the previously created websites/webapps, its giving error as "Unable to launch ASP.NET development server".
And when I try to debug the website/web app, I am getting error: "Unable to launch ASP.NET development server. An attempt was made to perform an initialization operation when initialization has already been completed".
Similar errors are coming when I try to open Windows Form Applications and other projects.
No errors are getting logged on event viewer and I cannot see any other error information apart from what is mentioned above.
I searched all over internet but no help. I have already trying un-installing VS2010 using the script at this link (provided by MS). But when I re-install VS2010, it still shows me same error. To my surprise, after re-installing VS still shows the previous project list in "Recent Projects". I really doubt if VS is getting uninstalled.
I am totally clueless and any help would be highly appreciated. I am left with no other option but to format my OS if I don't find a solution here :( Please do let me know if any other details are required...
It might be caused by an adding or extension that you've installed, maybe without being aware of.
there are several ways to deal with that - one is to get inside add in manager and remove/ deactivate them.
if VS can't load there is a flag that should do the trick.
check this link for instructions on devenv flags.
you can use: /ResetAddin or /SafeMode

Why Arent Breakpoints Working In Web Application Project

My company gave me a web application project and I went to debug it and set some breakpoints and they dont fire. I am using Response.Write all over the place to debug. Anyone know what maybe going on?
I am running the application off my localhost I was pushing F5, but since the breakpoints dont hit by making changes and adding Response.Write statements and clicking save then refreshing my browser I get the changes for whatever reason.
Hovering over the breakpoint it says "The breakpoint will not currently be hit the source code differs from the original version"
Another tidbit is I created a new web application project and created a breakpoint and it works, its only specific to this application it seems like, but dont know what it could be?
Hovering over the breakpoint it says "The breakpoint will not currently be hit the source code differs from the original version"
Try this:
Close Visual Studio and make sure any instances of ASP.NET development server are closed as well
Delete everything from "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files" (where v4.0.30319 is the version of your .NET Framework)
Definitely need more info, but I would check that your are building with debugging symbols to cover the dumb stuff.
Okay, after reading the comments posted on your question I was making the following assumptions.
You are running using the built in VS development server
You are compiling in debug mode
You've set debugging true in your web.config
I've seen this problem before and for me it's been resolved by restarting Visual Studio.
Assuming that you are running on IIS on the same machine that you have visual studio installed:
Have you attached to the application pool process
Is you code the same as what is deploy? (Is the latest version deployed)
Are you logged in as administrator?
Are you running visual studio as administrator?
Just to make sure, you are running in debug mode?
I ran into this problem a while ago as well, instead of using response.write, you could try outputting the data to a label control's text value instead to see the values of your code.
It's a bit of a sloppy work around, but I couldn't figure out why that one particular project I was working on didn't let me debug it.
This problem is, for me, mostly caused by a mismatch of the loaded dll files (symbols) by webserver, and those that the project are pointing to when you try to breakpoint. It's different files. I have located different causes. One could be a simple hang-up by webdev instans (force shutdown. But also that there occur some kind of mismatch if you got different compilation methods between project within same solution as the web project.
This desc may not be your exact problem, but perhaps it will lead you into right direction. I find this often being a dirty unlogic error that just are irritating (but also completely fixable without data loss or reconfiguring, when u understand the trick).
I had the same problem, and it turned out only Internet Explorer works with debugging and breakpoints. To avoid having IE as my default browser, I changed the launch settings in the .Web project to run IE with the path as command line parameters.

Visual Studio 2008 - The breakpoint cannot be hit

I know that many people have had this problem... but I am now having it and cannot solve the issue. VS 2008 is randomly giving me an error after working on a project for weeks. When I set a debug point, I get a warning: The breakpoint will not currently be hit. No symbols have been loaded for this document.
I have re-built the solution with no debug points and re-tried. I have also tried to Load Symbols from path and that has not worked either... Can someone please help walk me through the necessary steps to getting my debug function working again.
Thanks.
Delete the solutions suo file. This has fixed weird debugging problems with breakpoints every time for me. Note, you will lose your solution settings, such as bookmarks, breakpoints, and such.
1) Does creating a new project work? If so, you have a corrupted settings somewhere. Moving your files over to your new project would be the easiest procedure to resolve your issue.
2) Does taking your solution to another PC work? If so, then you have an issue with your environment.
Try these checks in order:
1) Select your Configuration Manager, check if your CPU is "Any" or your "x86" or "x64" depending on your hardware.
2) Try remove all the other configuration other than Debug. Add a new Configuration based on your Debug and the CPU as Any
3) Drastic move.. close your visual studio and run the following
devenv /ResetSettings
4) Even more drastic move...
devenv /Setup
Good luck
There is a hotfix for Visual Studio SP1 regarding debugging issues here. It did fix issues I had with catching breakpoints in multithreaded source code. It also fixes other potential causes for breakpoints to be missed, so it is definitely worth a try.
Also, have a look at this SO question.
Regards.
I run into this occasionally and each time the solution is a bit different. This time I was using a different user profile to develop than I normally do in Visual Studio 2008 and found that I couldn't debug (breakpoints cannot be hit) shortly thereafter - on a solution with 2 vb.net projects. I ended up doing 2 things but I think the latter did the trick for me.
In the main projects properties, go to the Advanced Compile
Options button on the Compile tab and ensure the "Generate debug
info:" is set to Full.
Right-click on the main project and
select "Set as a startup project"

Why won't my VS 2005 hit the break points?

I'm going crazy and wasting a lot of time. I am running in DEBUG, checked the web.config to ensure debug=true is there, checked the code to ensure I am reaching it, cleared all temp files and pdb's. The only thing that works is to continually kill the solution, create a new solution and add all the projects again. I shouldn't have to do this every day.
If you're using Windows Vista, try launching Visual Studio as an Administrator. Even if you're already running as an Administrator on the machine, still right-click on Visual Studio and select "Run as Administrator."
Right-click the solution node in solution explorer end select Properties. Check the configuration settings in there.
If you are attaching to a process sometimes this can be caused by symbols not being loaded. If you see the code skip over your breakpoint hover over the breakpoint it will tell you if symbols were not loaded. If that is the case Here are several potential solutions to your problem.
Clear out all files in C:\Windows\Microsoft.NET\Framework\v2.0.50727\ASP.Net temp files.
Ensure you deployed the *.pdb files to the bin folder of your application.
The web process has not loaded your assemblies at the time you attach your debugger. Reset the process and wait a little longer before attaching to the process to give the process a chance to load your dll's.
Actually your visual Studio is not attaching your project with process WebDev.WebServer.EXE
Do the following Steps:
click on Debug Menu
Click on Attach to process WebDev.WebServer.EXE
Now your Debugging is enabled.

Resources