views:

93

answers:

2

Background: Custom workflow activities for Microsoft Dynamics CRM.

Currently we have one project per custom activity, with a single class file in each project.

We would like to have a single project, with multiple class files, each compiling to a separate DLL to allow us to update them individually.

Is this possible?

+3  A: 

I don't think you can do this directly in Visual Studio, but, if you manually invoke the compiler in a script or makefile, it should be pretty straightforward.

For example, csc /t:library /out:MyCodeLibrary.dll simpleType.cs compiles simpleType.cs to MyCodeLibrary.dll.

You could run this as a post build step, to generate the assemblies you want. However, just be careful that whoever is using the project understands what is going on... most developers would expect a single project to produce a single dll.

Nader Shirazie
I'm going to go ahead and mark this as the answer. I tried a quick test with for %1 in (*.cs) do "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\csc.exe" /t:library /out:"%~n1.dll" "%1"and that seems to happily spit out dlls.Beginning to wonder if this is the best approach though.
david
Depends on who's using the project. Most of the time, doing what studio expects is the right answer, but I'd say you're well into grey area territory. The point is to make your life easier, and if using a build script makes your life easier, go for it. Otoh, if the overhead of multiple projects is worth it for some reason, then splitting it up may be right for you.
Nader Shirazie
A: 

You can have a single solution, with multiple projects. Building the solution compiles each of the projects. Is this not what you want?

Andrew Cooper
No, Having one solution with dozens of projects, each with only a single source file seems a little bit silly.
david
It seems to be the way Visual Studio is designed to function, though.
Andrew Cooper
Yeah I agree it would be the way they expect it to work. It just feels like overkill in this case. I was hoping there would be an easy alternative.
david
No sillier than a single class per DLL. :)
Josh Einstein
Nothing silly about it. If the CRM activity is simple and only needs one class then that's all it takes.
david