Visual studio modules window shows .aspx files instead of DLL name - c#

I am working on an ASP.NET project and getting the dreaded The breakpoint will not currently be hit. No code has been loaded for this code location.
I am running in debug configuration, and other projects in the same solution can be debugged properly.
I'm using Visual Studio 2017 Community edition, in the modules window I see an empty list, I have to right click and select Show Modules for all Processes to get anything to appear, and when it appears it does not show the name of the .dll, it shows the name of the .aspx page that the launched browser is currently sitting on, which will update as I navigate around the site.
From all the answers I have found online, it should be showing the name of my project's .dll file, such as MyProject.dll, then you can manually load the symbols from there by looking in the bin directory for MyProject.pdb (which does exist), but I am seeing the page name, Register.aspx, which of course will not work if I try to load the symbols for MyProject.pdb.
Or maybe I'm totally off-base here, I'm happy to provide any info that might help!

Related

Cannot find or open the PBD file

Working on an ASP.NET C# web application project in Visual Studio 2022. I've been having the infamous "Breakpoint will not currently be hit. No symbols have been loaded for this document" error when trying to debug.
I've poured over questions here looking for solutions. I am definitely running the debug configuration, and just found out that, in the Module window, absolutely nothing had loaded.
I found a solution for getting some to load by switching the browser I was debugging in (Google Chrome -> Edge). But, now that I have modules in the window, most have "Cannot find or open the PDB file" under the "Symbol Status" column, and my breakpoints are still encountering the same error.
I have been at this for a day or two now with no solutions. I'm not sure where to go from here. Any advice, solutions?
Diagnosed that no symbols had loaded for my project, and expected breakpoints to start working once they had. Symbols have still not loaded properly and breakpoints are still broken.

Can't debug ASP MVC project using Telerik Open Access in Visual Studio 2015

I'm unable to debug a project. I'm getting the "The breakpoint will not currently be hit. No symbols have been loaded for this document" error. I've tried everything I could find online, but nothing has worked. I'm hoping someone out there will be a fresh pair of eyes to find the problem.
First of all, I inherited this project from a coworker who has left. He did development on his machine where he was able to debug it. He uploaded it to Subversion which is where I got it. Another coworker was able to download it and debug, but I cannot.
Second, I'm using Visual Studio 2015. The project is an asp MVC project. There are two projects in the solution: the main project with the views, controllers, models, etc. and the secondary project which is only the Telerik.OpenAccess code (the "data layer"). It's this secondary project that I can't debug.
* Update *
Following a suggestion on another board, I hit a break point in my main project and went to Debug-Windows-Modules where I can see the message "Binary was not built with debug information". I went to the folder shown and can see my pdb file was not made at the same time as my latest dll fill. My project is set to debug mode and build. What do I need to change to get the pdb file to be recreated along with my dll?
* End Update *
So here's the line in the main project I've got my breakpoint:
rep.UpdateWorkOrderVendorHeader(oaObj);
The breakpoint hits here. It's calling a function in the secondary project. When I try to step into that function, it skips to the next line in the main project. If I look in the secondary project, I see the "symbols not loaded error". I also have a breakpoint directly inside the secondary project and still it gets skipped:
I've found two stackoverflow streams that covered a variety of scenarios, but nothing has worked for me:
Fixing "The breakpoint will not currently be hit. No symbols have been loaded for this document."
The breakpoint will not currently be hit. No symbols have been loaded for this document in a Silverlight application
Here is everything I think I've tried so far, but I may have missed something:
Restarted Visual Studio
Deleted code and copied code from co-worker that could debug secondary project
Build - Clean and Rebuild & Clean and Build
Deleting bin and obj folders
Checked configuration set to debug and build
Checked debug and trace constants are checked in the project properties
Click Debug - Start new instance on secondary project
Selecting multiple startup project (threw error saying the secondary project could not be started directly)
Debugging in IE instead of Chrome
Checked the reference to the secondary project in the main project has the correct directory
Checked that Project - Properties - Build - Optimize code was unchecked
Checked that Project - Properties - Build - Advanced settings were the same for both projects
Checked that Project - Properties - Build - Advanced - Output was set to full
Adding to the secondary project's App.config
Making sure I was running Visual Studio as administrator
Checked that Project - Properties - Build - Output path was /bin
I'll include seem screenshots of the config and properties below. Below is also a description of my project tree with some of the relevant files. I'd appreciate any suggestions you can give me. Thank you!
Koorsen (main project)
References
Koorsen.OpenAccess (secondary project)
C:\inetpub\wwwroot\Koorsen\Koorsen.OpenAccess\bin\Debug\Koorsen.OpenAccess.dll
bin
Koorsen.dll
Koorsen.pdb
Koorsen.OpenAccess (secondary project)
bin
Debug
Koorsen.OpenAccess.dll.config
Koorsen.OpenAccess.pdb
Koorsen.OpenAccess.dll
Telerik.OpenAccess.35.Extensions.dll
Telerik.OpenAccess.35.Extensions.xml
Telerik.OpenAccess.dll
Telerik.OpenAccess.xml
Release
Koorsen.OpenAccess.dll
Koorsen.OpenAccess.dll.config
Koorsen.OpenAccess.pdb
Telerik.OpenAccess.35.Extensions.dll
Telerik.OpenAccess.35.Extensions.xml
Configuration Manager:
Build properties:
Advanced debug properties for main project:
Advanced debug properties for secondary project:
Didn't receive an answer, but I was able to figure this out over a couple of days of trial and error. Posting this here in case it helps someone. Here is what I ended up doing.
Put a break point in the main project and ran the solution. When it hit the break point, I went to Debug->Windows->Modules. Found the name of the dll for the secondary project and noted the folder it was trying to use. I my case it was in C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\213421ba\66682af2\assembly\dl3\e121f20c\957624fe_d9ded101. The dll and pdb files did not have the same date. Rebuilt the project; the dll was updated, but not the pdb. Found a suggestion in another forum suggesting deleting the dll and pdb and rebuilding. This didn't work; the dll was recreated, but not the pdb. I deleted the entire vs folder.
Used NuGet package manager to uninstall and reinstall 2 Telerik Data Access packages to all projects.
Deleted the bin and obj folders in the secondary and main projects. May have been able to get away with just doing this in the secondary project.
At this point the secondary project compiled, but the main project did not.
Had to add some dll files back to the bin folder of the main project from third party extensions.
Still would not compile. Compared every reference, bin and obj file to those of a coworker who was having the same problem, but hadn't tried to fix being able to debug yet. Found 3 extra references. Removed them and the project worked again and I was able to debug the Telerik Open Access project.

Visual Studio 2013 is running old code

I have searched and found other topics on this, but none of the solutions seem to work for me. Visual Studio is running old code in debug mode and release mode. If I go to the actual directory and launch the exe, it is the latest code. It is a XAML project.
Things I have tried:
1) Deleted bin and obj folders
2) Rebuilt solution
3) Cleaned solution
4) Made sure the project is set to build in Configuration Manager
Update: I tried adding a new configuration in Configuration Manager. The path is totally different, and it still running the old code. The exe built with the new config is the right code when I launch it manually, but it seems like visual studio is running a cached version of the exe.
Another gotcha I see a lot - be careful with shortcuts. If you are opening the solution via Recent Projects or another shortcut, try opening it via File -> Open or clicking on the solution file itself instead. I see a lot of developers looking at old code or the wrong branch because of this.
Can also try changing the assembly version number. Every once in awhile that will somehow make a difference.
I am not sure what exactly helped, but one thing is certain:
i marked .js file properties "Build action" as "Compile".
Tryed to deploy (got an error of course), and changed it back to "Content".
Rebuild, deploy, run debugger and FINALY it works on my current code.
The Error is back on my "new old" code
What i do is:
click "Continue", go to opened IE window with my page\site, press CTRL + F5,
and what i see?
My new current code inside VS debugger...
Error is gone

Winform project migration question

I have got a few projects and when I run them on another computer, it fires an error that says: the debugging doesnt belong to...
and it opens a browser dialog box as if it wants me to point to the missing file..
How can i overcome that problem?
"Entering break mode failed for the following reason: Source file:"D:Document and Settings..."(path to the old directory the files were).. doesnt belong to to the project being debugged.."
Try look here:
"Entering break mode failed for the following reason: Source File XXX does not belong to the project being debugged
from the above post:
I found 2 things that may have helped:
1) I had previously moved the folder location of a dependent project,
then removed and re-added the project to my solution. However, the
"References" of the depending project still showed the path to the old
location. These properties are unfortunately read-only within the
GUI, so I just removed and re-added the project reference.
2) I noticed that my Visual C# 2005 Express doesn't have a "Build",
"Clean Solution" menu option. Instead, I closed Visual C#, deleted
the "bin" and "obj" directories under each project, restarted Visual
C#, and things are working as expected again.

How do I debug a published XBAP file in VS2010?

I need to debug a full-trust application either by specifying a URL or, ideally, from within the web app I am intending to deploy it to. I've tried the following:
Running "PresentationHost.exe -embedding" from the command-line, attaching through Visual Studio. The IDE shows that my breakpoints are valid until I actually attempt to load the .xbap file, at which point it shows that there are no symbols loaded. None of my breakpoints are hit. I've tried "mage -cc" before doing this per several recommendations elsewhere.
Hard-coded URL in the project's Debug panel then F5. Alternatively, "PresentationHost.exe -embedding -debug" and attach to process then load the .xbap in IE. Both result in the following error when the page appears:
System.ArgumentException: URI formats are not supported.
at System.IO.Path.NormalizePath(...)
at System.IO.FileStream.Init(...)
at System.IO.FileStream..ctor(...)
at System.Windows.Interop.ApplicationLauncherXappDebug.GetIdFromManifest(...)
at System.Windows.Interop.ApplicationLauncherXappDebug.GetApplicationIdentity()
at System.Windows.Interop.ApplicationLauncherXappDebug.Initialize()
at System.Windows.Interop.DocObjHost.MS.Internal.AppModel.IBrowserHostServices.Run(...)
Found it. The "PresentationHost.exe -embedding" will work, provided that you select the .pdb file to be published, which it is not by default. This follows from what I saw before, where the debugger appeared to have symbols then not, once the app actually loaded. To clarify:
Go into the Publish tab on the project properties
Click "Application Files..."
Check "Show all files"
Select the .pdb file for the executable to be included.
Republish
PresentationHost.exe -embedding
Attach to process or set the project to run this out of the debug tab
Launch the web page in a browser and navigate to the xbap file, breakpoints should be hit now.
If you have access to source code and you deploy on localhost you can simply add System.Diagnostics.Debugger.Launch(); in your code. This will allow You to attach with VS to any process your XBAP is using.

Categories

Resources