开发者

Unity 2.0 loose dependencies - dll copying

I have a simple question that I think som开发者_JAVA百科eone will answer very fast, but I tried to find the answer myself and couldn't (maybe just bad luck).

The thing is, that I have a .NET 4 solution in VS2010 Ultimate in which I want to take advantage of Unity 2.0. I have some modules designed to be seperate, where I connect the code by a shared *.Contracts assembly (e.g. classes in DAL implement interfaces from DAL.Contracts, and Services require types implementing interfaces from DAL.Contracts).

The problem is, that I have to get the compiled files into the final output directory. Adding reference seems strange, after all I didn't want a reference (and I know that it can be done without it). Adding the files as links with "Copy when newer" option is not good too (no way to differentiate between Debug and Release builds). What is the consensus about the best way to make the compiled components copy to the directory with the topmost assembly?


Use PostBuild events as @DaMartyr suggests or decompose that part of your build out of the solution and use batch files or something like NAnt or MSBuild to move files to where they need to go for debugging.

I find for anything non-trivial taking the extra steps to create a build script outside of visual studio to be the way to go as it can be used by the build process and is easier to manage than build events.


You can use XCopy commands in the PostBuild Events (Project Properties->Compile->Edit Post Build Events).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜