Search This Blog

13 August 2010

Cold not load type '...' from assembly '...' during builds on different targets

A hard to track down error occured during my current project that required several hours of work before finally getting solved by a very simple solution so I feel I should give some information about my problem and the solution found to save others from doing the same work.

The problem is that we are using multiple build configurations with substitution files for Test, Development and Production environment.When building for some environment and then switching configuraton and adding some classes, or when other classes are checked in, in some circumstances a problem will occur when different assemblies cannot not be found.

The thing that makes this even harder to figure out is the fact that while using MS Test to run the test the tests will fail but if you enter debug mode the tests will pass without any problems.

The solution is to make a clean of the entire solution not just the current configuration, either by switching between the configurations and cleaning or running a batch build and cleaning all different configurations and cleaning them up and rebuilding.

The reason while this is happening is that some files cannot be deleted for some reason and the build actually fails to rebuild the assemblies needed.

No comments:

Post a Comment