Could not load file or assembly '...\Sandcastle\EWSoftware\Sandcastle Help File Builder\SandcastleBuilder. Utils.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded..

Topics: Developer Forum, Project Management Forum, User Forum
Oct 18, 2013 at 4:36 PM
I've been using this tool for the last two months for our project documentation, last week I started getting this error:
C:\P4\depot\main\EngSwTools\Hyperion\src\Libraries\Sandcastle\EWSoftware\Sandca
stle Help File Builder\SandcastleHelpFileBuilder.targets(38,5): error MSB4062:
The "SandcastleBuilder.Utils.MSBuild.BuildHelp" task could not be loaded from t
he assembly C:\P4\depot\main\EngSwTools\Hyperion\src\API_doc..\Libraries\Sand
castle\EWSoftware\Sandcastle Help File Builder\SandcastleBuilder.Utils.dll. Cou
ld not load file or assembly 'file:///C:\P4\depot\main\EngSwTools\Hyperion\src\
Libraries\Sandcastle\EWSoftware\Sandcastle Help File Builder\SandcastleBuilder.
Utils.dll' or one of its dependencies. This assembly is built by a runtime newe
r than the currently loaded runtime and cannot be loaded. Confirm that the <Usi
ngTask> declaration is correct, and that the assembly and all its dependencies
are available.

But I am more than sure that I didn't change any configuration. I updated to latest Sandcastle and latest Sandcastle Help File Builder, but the problem is still remains..

Any help will be greatly appreciated, since this is critical issue for our team.

Thanks!
Coordinator
Oct 18, 2013 at 6:18 PM
You are more likely than not using the wrong version of MSBuild to build the SHFB project. You need to make sure that you are using MSBuild 4.0. Anything earlier will not be able to load the SHFB build targets and thus you get the error message above.
Marked as answer by EWoodruff on 10/18/2013 at 12:05 PM
Oct 18, 2013 at 6:57 PM
Edited Oct 18, 2013 at 6:57 PM
How do I make sure ? Can you point me to a place where I can specify to use MSBuild 4.0 ? thanks....
Oct 18, 2013 at 7:19 PM
found it! thanks