2

I've written a series of check-in policies and based on principals of OOAD, I used some inheritance and stuff to reuse some code.

Now I've got this hierarchy:

  1. General set of check-in policies
  2. Specific set of check-in policies

Each is a class library project, and the specific class library references general class library.

Now I don't have problem in loading general set of check-in policies. But when I want to load specific set, Visual Studio complains that it can't load the DLL, and it's so dumb, that it doesn't give me more information there:

enter image description here How can I debug it? I'm stuck at this step. I can't find why it can't load my DLL, and I can't find LoaderException details.

Nasseh
  • 429
  • 1
  • 4
  • 12
  • When combining projects you should never copy a dll from one project to another because the source code is no longer link to the dll. When combining project always browse to the dll where the source code is located. I usually use the Solution explorer and add an existing item to the project. The best solution is to copy the bin folder in the main project and then delete the bin. Then delete all the dlls in the Solution Explorer and add them again this time browsing to the folder where they were built. – jdweng Jan 04 '16 at 12:42

1 Answers1

3

If you want to debug your check-in policy. Go to the properties of your check-in policy class project and look under the debug tab, find a Start Action. Select to "Start external program" and browse to where you have visual studio installed. C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe enter image description here With this in place and the proper registry keys for loading the policy DLL from your debug folder all you need to do is hit Run and a second copy of VS will load up.

If you want to debug a class library (DLL) project in Visual Studio, please reference this How to debug a class library in Visual Studio

Community
  • 1
  • 1
PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • I did this, but just another instance of Visual Studio opens. I have a class library, thus I turned it into a Console application and in the entry main method, I wrote some code. But still my breakpoints are not hit. How to run code here? – Saeed Neamati Jan 24 '17 at 09:15