0

I created 2 instances of same project to apply different changes. So when I open project1 and debug class1, everything is smooth, I can have my breakpoints hit all other debugging features. When I open project2 and close project1, I try to do same debugging on class1(some lines of the code is different), I get warning that

"the breakpoint will currently not hit. a copy of class1.cs was found in project1.dal.dll, but the current source code is the different from ther version"

When I close the VS completely and reopen the projects or If I clear the Temporary ASP.NET Files, Problem is getting resolved. But it happens everytime for me. so my questions are;

1) I wonder why does it happen and how can I resolve it without closing VS or clearing cache files?

2) I know the option called "Uncheck Require source files to exactly match the original version".. Is it safe to do it? or is there any side affects or disadvantages

Emil
  • 6,411
  • 7
  • 62
  • 112
  • 1
    Why do you need two versions of the same class? – artm May 27 '15 at 13:35
  • It is not the same class but entire project indeed because i am accessing 2 different DB to compare performance. As i said also business logic, I have changed in 1 of them to compare as well. I could have done differently using unit tests etc maybe but this was the fastest way for my purpose. – Emil May 27 '15 at 14:20
  • @artm for example what happened is the following. I was debugging 2 versions of nopcommerce to see some differences. i had 3.5 and 3.6 versions opened but I only started 3.6 version, funny thing is that on the browser 3.5 version displayed (design is totally distinctable). althought i didnt even start debugging 3.5 source code. – Emil Jun 19 '15 at 09:36

1 Answers1

1

It is impossible to debug your code in that way - you are creating different symbols for each build so when you debug one version, the other is not compatible with the previous one.

To make the long story short - you cannot debug one version of code when symbols from another version are loaded.

More info: Fixing "The breakpoint will not currently be hit. No symbols have been loaded for this document."

EDIT:

Check this link also: What is the "Temporary ASP.NET Files" folder for?

Community
  • 1
  • 1
kamil-mrzyglod
  • 4,948
  • 1
  • 20
  • 29
  • I forgot to mention that they dont share same class library projects. They are also with same name but different source code. Isnt it that build time DLLs are regenerated or updated under BIN folder of website project? Why should they affect each other unless something goes in the temp cache folder? – Emil May 27 '15 at 14:18
  • @batmaci - hmm, can you share screen with projects` structure? Sure, DLLa are regenerated after build but you have to rebuild project each time you want to attach a debugger - even if you didn't make any changes. – kamil-mrzyglod May 28 '15 at 06:14