visual studio - Whats the best way to set up a VS project that uses mutiple external open source projects? -
i have large project replacing 2 parts of better open source alternatives. open source libraries pretty big stable , unchanging including source in vs project directly seems pointless me - more load, more compile etc. rather build 2 open source projects alone, @ fixed version , reference them main project.
but gives me couple of problems.
i want debug , release versions of libraries - vs has no way switch between references based on defines.
debugging harder if want step code in other projects - not simple stepping through code - or it?
something else i've not yet thought of...
so while play around ideas thought ask how guys set up.
the main project , 2 open source projects in different svn repositories. open source projects not getting new trunk every day, fixing on release.
thanks
1) can switch between references different build configurations if manually editing .csproj file.
the csproj file msbuild script xml. if browse down should find <itemgroup> element contains bunch of <reference> elements. can add condition 1 of these reference elements this:
<reference condition=" '$(configuration)' == 'debug' " include="system.drawing" />
the include attribute can contain full strong name of assembly, may not different debug , release builds of binary. in case, can add <hintpath> element include path .dll.
<reference include="assembly strong name"> <hintpath>c:\librarystuff\debug\library.dll</hintpath> </reference>
your hint path can relative:
<hintpath>..\..\librarystuff\debug\library.dll</hintpath>
[disclaimer: i've never done references though, can't guarantee there won't issues. tested out , seems work fine, although visual studio display both references no matter build config have selected (although builds 1 matching config type). puts warning icon on second 1 if have matching names, compile seems work fine.]
if have problems, try having 1 reference 2 different hintpath nodes , putting conditional on hint path.
2) provided have .pdbs , source code in correct places , accessibly, should able debug straight through library stepping code though referencing .dll file.
Comments
Post a Comment