I have a project using StructureMap working well (Testing Console App). When开发者_Python百科 I create a second project (windows service) with a reference to Structure Map the first project dies with compile errors because it cant find StructureMap. If I re add a reference to the DLL to the first project the second dies in a similar manner.
The DLL is being referenced from a directory in the project root....
Anyone know how to fix this annoying (really really annoying problem)?
If you are adding the reference to the dll, make sure the right build order is set( which is your StructureMap built first). Right click on the Project name in Solution Explorer and you can see the "Project Build Order" as an option.
But in your case, I would recommend you use the cross-project reference. Add a reference to the project instead of the dll.
As Marty Trenouth states in the comments to the question: change the target framework from .NET 4 Client Profile to .NET 4 and it should work.
I just added this answer, so other readers might find a possible solution without reading all the comments.
精彩评论