How to get a smooth debugging experience in Visual Studio 2008 when using dependency injection?

What are the best practices for ensuring trouble-free debugging in Visual Studio 2008 when using dependency injection (DI)?

In particular, suppose I have a solution with three projects:

MySolution: - ConsoleApp - ServiceInterface - ConcreteService

ConsoleApp has a link to the ServiceInterface project and uses the DI container to resolve a specific type (from the ConcreteService project).

When I start debugging, ConsoleApp will not be able to load a specific type unless ConcreteService.dll is present in the ConsoleApp bin \ debug directory.

So the question is, how can I get ConcreteService.dll in the bin \ debug folder in ConsoleApp?

Some parameters that I was thinking about are a post-build script, adding a project link to ConsoleApp for ConcreteService and copying the dll manually.

There are some pros and cons to all of these approaches, so I am interested to know if there are other approaches, and if not, what approach people prefer.

+3
source share
2 answers

You can change the output directory of each project to the same directory. I used MySolution \ Debug to debug DI projects so as not to add links.

Addressing the first comment

, , DI ? , , ?

, . , Release, .

MySolution\ConfigurationXDebug ( - ) . , , .

+2

.

, , . , , , , .

+3

Source: https://habr.com/ru/post/1727685/


All Articles