Reputation: 800
I've got two projects in my solution. Number one is a class library and the second one a console app.
The reference worked fine before, and I could debug the code in the class library when running the console app. But it stopped working after I've made a change (changes to methods) in the class lib. Now the debugger won't attach in the class lib. I can debug my console app.
I've tried to remove/add the reference (after a new build) but no luck.
It seems to reference an old dll. But I've checked the path to the reference and it points to bin/Debug in my class library project and the date matches when I re-built the class library.
Someone knows why this is happening?
Upvotes: 0
Views: 647
Reputation: 76880
Someone knows why this is happening?
Did you rebuild your class library project after you made a change (changes to methods) in the class lib? If not, that is the reason why you get this issue.
When you add the reference and make it points to bin/Debug in the class library project, the debugger will be easy to access the .pdb file in that path. However, if you made any change in the class lib without rebuild the project, the old .pdb file will not match the source code. So the debugger won't access in the class lib due to the mismatch .pdb file.
To resolve this issue, you should rebuild your class library project after made any modification in the class lib. Or you can just add the reference by Project-Reference rathan than Browse. In this case, Visual Studio will rebuild the referenced project automatically before debugging.
Upvotes: 1