views:

109

answers:

3

My SAAS company has two C#.NET products, call them Application Alpha and Application Beta. Both of them reference some libraries that we can call Core.

At the moment, the codebase is monolithic, stored in a single SVN repository with a single .NET solution, and we're trying to make it more modular/componentized. We've split off into separate repositories for the two applications and the core library, but we're now running into the following problem:

Alpha and Beta must reference Core, but we're trying to avoid having a direct code reference because then we're practically back to square one: you would need to check out and co-locate all repositories. So how should we go about referencing assemblies between these components?

Each component could have a directory containing DLLs from the other components that need to be referenced, stored in SVN, but this would mean extra effort any time Core is updated to push out the new DLLs to Alpha and Beta.

Or we could store the DLLs in a central SVN'd location (and/or in the GAC), but that would mean extra effort any time Core is updated for everyone else to pull the new DLLs.

Is there a third option that we're overlooking?

A: 

I have something similar in which I have 5 applications utilizing a series of web controls I built. The controls are compiled into a series of DLLs for modularization and the applications that utilize them live on separate servers.

What I do is utilize VS2008's build utility to execute a batch file that copys the compiled (updated) DLLs to the production servers when a Release Build executes.

You do this by going to the project that builds into the DLL (or DLLs) and right click on that project and goto Properties. Then you goto the BUILD EVENTS tab. There you see Pre-Compile command line and Post-Compile command line textboxes.

Therefore your release builds can be fully automated and you never have to worry about DLL hell-like differences between versions of your production DLLs.

Hope this helps, JP

Jonathan
Thanks. How do you reference DLLs across different servers, though? Using a network share? We were considering storing the DLLs on a network share, but that could cause developers' working copies to clash with each other, and our office network is a bit flaky so we don't want to rely on it.
A: 

you could have your rebuild script for Alpha and betat create artifacts (namely build core) and place the result of the core build at a specific location referencing that location.

Rune FS
This would still require that each developer do the checkout of Core separately, which is something he's trying to avoid.
Reed Copsey
As Reed Copsey said, that would require having Core available and in a specific location to be built, which is what we're (hopefully) moving away from. I am interested in what you mean by "create artifacts" though. Is this a Visual Studio term I just haven't encountered before?
A: 

You could use SVN:externals. It was designed for this type of scenario.

If you want to avoid that, these are probably your better options. I'd avoid putting the files in the GAC, though, unless your core project is very stable, and not changing very often. Having the DLLs local provides much more flexibility.

Each component could have a directory containing DLLs from the other components that need to be referenced, stored in SVN, but this would mean extra effort any time Core is updated to push out the new DLLs to Alpha and Beta.

This could be handled fairly easily with a good build system. This approach has some disadvantages (ie: exectuable depdenencies in the build system), but has some advantages, including allowing each dependent project to have different versions as needed, etc.

Reed Copsey
I'll look into SVN:externals, thanks. Perhaps I can find a way to set it up so that each repository's external dependencies are checked out in read-only mode, just to make sure I don't accidentally muck up Core while I'm working on Beta for example.
Yeah - you can do this via standard SVN security handling.
Reed Copsey