简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM