VS.NET: Reference EXE assemblies

Published 21 June 7 2:49 PM | jop

Nice! Visual Studio 2005 now allows Class Library projects (DLL) to reference Applications (EXE).

On Visual Studio 2003, EXE projects are not listed on the Add Reference dialog. The .NET framework does not put any restrictions on what you can reference. I think the IDE programmers thought they're helping us (or me) by only showing the DLLs there.

It's a problem because I used to work on some applications that are not big enough to warrant separating the UI and the core logic. I would only have a single EXE assembly but I am forced to create a separate assembly for classes that needs to be tested because my test projects can not reference the EXE file.

I am currently working on a small utility application so I tried it just now and it worked! Very nice...

Filed under:

Comments

# Frans Bouma said on June 21, 2007 1:20 AM:

You can just rename a .exe to a .dll and reference it instead.