Attaching to the correct process but unable to debug - No symbols have loaded error - VS 2008 - visual-studio-2010

I am trying to debug a web application hosted in local IIS web server. I have attached the VS debugger to the process but get the error - "The breakpoint will not currently be hit. No symbols have been loaded for the document".
I have done the following things:
Deleted the bin/obj folders
Cleaned and rebuilt the solution
Closed and reopened the solution
Things I noticed:
Opened Process Explorer and made sure I am attaching to the correct process.
Opened Debug-Windows-Modules but cannot find the project dlls and referenced dlls (Does this notify that the right process is not attached?)
Please share your suggestions. Thank you.

This error will also show up if you have attached to a process that was compiled in release mode.

Related

IIS Express crashes when starting a site from visual studio

I started encountering this problem after installing the Visual Studio 2015 RC; I am no longer able to debug web projects from Visual Studio 2013.
My projects build fine and VS launches a browser - I can see in my output that iisexpress.exe loads all the relevant DLLs for the project, but then right when I would expect to see my website, iisexpress.exe stops running and Visual Studio stops debugging. All the output Window tells me is this:
The program '[3724] iisexpress.exe: Program Trace' has exited with code 0 (0x0).
The program '[3724] iisexpress.exe' has exited with code -532462766 (0xe0434352).
Looking in the event viewer I see the following crash info for iisexpress.exe:
Faulting application name: iisexpress.exe, version: 8.0.8418.0, time stamp: 0x4fbaa9e8
Faulting module name: KERNELBASE.dll, version: 6.1.7601.23040, time stamp: 0x553e86a2
Exception code: 0xe0434352
Fault offset: 0x0000c44d
Faulting process id: 0x1b40
Faulting application start time: 0x01d094d5c74c69d5
Faulting application path: C:\Program Files (x86)\IIS Express\iisexpress.exe
Faulting module path: C:\Windows\syswow64\KERNELBASE.dll
I've tried reinstalling IIS, deleting my local IISExpress folder, and still no luck. Anybody have an idea how I can get IIS running again?
In your project folder find the hidden .vs folder and delete it. This solved the problem for me.
On my code this error was caused by an infinite loop, try to check if you have a loop like that in the following example:
public int InfinitiveLoop(long param)
{
return InfinitiveLoop(param);
}
Considering faulting module is not on IISExpress's dll files, this might be caused by either your web project or an unknown VS issue.
One thing we can try is to start the problematic web site without using VS.
You can execute IISExpress.exe with /siteid option. You can find the site id from applicationhost.config which is placed on the config of IISExpress directory.
For example, if the site id is 2, you can run this command:
"\Program Files\IIS Express\iisexpress.exe" /siteid:2
If the web site still does not work, showing the Access Violation issue which you ran into when you launched the website via Visaul Studio, maybe you will need to narrow down the issue why that happens.
If the web site runs okay if you don't use Visual Studio, it might be caused by some Visual Studio issue. In that case, considering you used RC build of Visual Studio, you will need to upgrade VS 2015 first and check if the issue is still reproducible.
Try deleting .vs folder from your project folder.
Found the solution here
On top of all answers here, I believe this answer can be helpful to figure it out why this issue occurred: System.StackOverflowException. I started my application without debugging and the two errors were IIS crashed and vstest.executionengine.x86.exe has stopped working (when trying to run the unit tests). Unfortunatelly, in the window event viewer I wasn't able to see the actual error. I saw it just when I started my application with debugger. So, if you have one of these errors, before doing some other investigations, please check your code. Because I was dumb, it took me 1 hour of my work time :(
In my case it was a circular reference caused on my part. There was no error, clue, output, any trace of why it was happening which would have saved me an hour or two.
I just had to delete .suo file of the project and rerun. That solved the problem.
I used #kernowcode solution of deleting the .vs folder, and it worked for me. But if you are a newbie like me, you probably have no clue where this .vs folder is.
I found it by opening my folder in the file explorer at the root directory. If you don't see it, you need to show all hidden files. Here are some pictures
1. Right-click on the project and click on "Open Folder in File Explorer"
2. At this point you probably will already see the .vs folder and you can delete it but if you don't, click on view and make sure hidden
items is check
3. Delete that .vs sucker and cry no more!
None of the above answers worked for me but I finally found what my issue was. Hopefully this will help someone down the line.
First run IIS Express from command prompt to validate that the site can or cannot be run.
Im my case, i got an error saying that C:\Windows\Microsoft.NET\Framework64\v4.0.30319\CONFIG\web.config had malformed xml on line 14. Looking at that line in the file it just said null null null null null etc.
The fix for me was to replace the web.config file with one from my coworkers'. IMPORTANT: you must get the file from someone running the same version, ie if you are VS2015 get a copy from someone running VS2015. If you get it from someone running a different version you will see an error saying it could not load an assembly from the manifest.
Hopefully this helps someone that has tried all the suggestions above. I think the cause of this for me was updating from trial mode and adding a product key within VS2017
Clean and build project and it will work
I had a similar issue and this worked for me:
(i). Deleted IISExpress folder in Documents.
(ii). Deleted almost everything in temp folder %temp% (may not be necessary but ...)
(iii).Went into Control Panel\Programs\Turn windows features off and on and enabled IIS.
(iv)Launched VS2013 project and opened and ran much faster with no apparent issue.
My symptoms:
iisexpress.exe' has exited with code -2146233082 (0x80131506)
Starting in VS crashes IISExpress on startup in System.Web without any logging and tracing
Starting is possible (As Jeong Hwan Kim mentioned) from command line, but OData und WebAPI do not work
Solution:
I found out, that the application starts from VS when I remove the WebAPI and OData Route (inclusive EnsureInitialized). So I updated all WebAPI libraries to version 5.2.4 and System.Threading to 4.3.0 and all problems vanished.
Open new visual studio project and copy and paste the same project it worked .Sometimes it might be due to visual studio issue.
Thanks
I just battled with this and my issue was having a different version of Autofac.dll in my web folder than in sub projects. So if you have tried all of these options and nothing works, check your DLL versions...
Keep in mind as I didn't realize, the .vs file is a hidden file on Windows 7. Not sure about other OS.
The problem was caused for me when a method called itself - resulting in an infinite loop.
Resolution, remove the call from the method
In ASP.Net Core, I was missing .Run() method in WebHostBuilder in Program.Cs.
Ideally, the code inside Main method should look something like below:
CreateWebHostBuilder(args).Build().Run();

How do I stop an instance of a custom DLL in Windows Server 2008 R2?

One of my Visual Studio projects generates a custom DLL that is run in a folder of the main web site (and the web site is a web site, not a web application, so I'm not publishing from VS - all files are copied manually). Whenever I make changes and overwrite the DLL, I don't immediately see my changes, I suspect because the web site is running the original DLL file cached in memory.
How can I identify and stop the process that is running the DLL? Even if I delete the DLL from the folder the site still runs just fine, sans my changes. I have also stopped and re-started the application pool and site in IIS.
"Back in the day" we would stop a svchost process, but I don't see anything like that in task manager.
Thanks for any help you may provide!
Mike
Go and get Process Explorer, it has a feature called DLL View that will allow you to see which DLLs are being used by which process.
Read Getting a list of DLLs currently loaded in a process for screenshots of how to enable DLL View.

Unable to find an entry point named 'GetCurrentPackageId' in DLL 'kernel32.dll' when using Visual Studio debugger

I have an ASP.NET which calls an asmx web service. It works fine on one machine with or without using the debugger in VS 2010. On another machine, it gives an error "Unable to find an entry point named 'GetCurrentPackageId' in DLL 'kernel32.dll'" in the web service constructor and when launched in the debugger. If the app is running without the debugger it runs fine. If the debugger is attached to w3wp.exe, the app runs fine and breakpoints are reached. This is in Windows 7 64bit. The same app exhibits the same behavior under VS11beta.
Any ideas why I get this error when using the debugger.
I recently noticed the same thing started on a machine that previously worked just fine. The only change that occurred was the installation of Visual Studio 2011 Ultimate Beta 1. The problem has unfortunately persisted after the uninstall of 2011.
More specifically, it's happening with projects that were opened with the beta.
I was experiencing this problem and deleted my [projectname].suo file. This file exists in the directory where the .sln file is located.
Once I did this the problem no longer exists.
Be sure to back up this file before you try this, and know that you may have to reset a few things (startup project, etc)
The exception is thrown and handled deep inside the .NET Framework. However, you have enabled the option to break even on properly handled exceptions. (I know, because I did too.) You can safely disable that for EntryPointNotFoundException.
Seems like Microsoft is working on this issue
https://connect.microsoft.com/VisualStudio/feedback/details/732334/unable-to-find-an-entry-point-named-getcurrentpackageid-in-dll-kernel32-dll

Build error in VS 2010

I am getting this error in my application
Error 1 Unable to copy file "D:\myproj\bin\Debug\myproj.dll" to "bin\Debug\myproj.dll". The process cannot access the file 'bin\Debug\myproj.dll' because it is being used by another process.
How to fix it
Your project dll is being used by another process. Either you ran your application and it didn't fully shut down (check the task manager) or some other program is trying to consume the dll in the d:\myproj\bin\debug\myproj.dll
For example, in the olden days, if you used a .Net dll in a VB6 app, and pointed to the debug dll, it would grab on to that and you'd have to shut down VB6 to free the dll.
I suspect you'll have to do something similar.
Start by checking task manager and making sure your app isn't still running.
Then close down any other apps that have a reference to your dll
If neither of those two work, close down studio and restart it

Visual Studio Creating Debug File In Release Mode

I asked a similar question a while ago Error Creating Debug Information - Code Won't Compile but never found a solution.
That problem seems to have evolved a bit. Now Visual Studio is creating a PDB debug file even when the application is in Release mode and debugging is turned off in Web.config. This PDB file is getting locked by Visual Studio and sometimes w3wp.exe. Compiling fails saying the PDB file is in use by another process (devenv.exe, w3wp.exe, or both). I cannot compile until I use Unlocker to release all the locks.
First off why is VS creating a debug file when in release mode?
Secondly how can I fix this? I have run a repair install on VS and re registered ASP.Net with IIS but that didn't help. I am using Windows Server 2003, VS 2008 Standard, and IIS6.
The first symptoms showed up a week or two ago when I was working on a WPF application. Until today putting the project in Release mode made the problem go away. Now it is happening even in Release mode.
Any ideas?
PDB files are created for release builds too - that is by design so you can still debug crashes in a release binary.
The PDB file is certainly not required for running. However, if it is in the same directory as the binary being run, IIS may be loading it (not really sure what IIS does here though). You can copy the binaries to a different folder (minus the PDB files) to prevent this problem.
Did you try this: http://callicode.com/Homeltpagegt/tabid/38/EntryId/24/How-to-disable-pdb-generation-in-Visual-Studio-2008.aspx?
You can also add custom after-build event to release configuration to delete the pdb file if everything else fails.

Resources