Reputation: 1029
When working with Visual Studio in general (or Visual C# Express in my particular case), it looks like each project can be configured to produce only one output - e.g. a single executable or a library.
I'm working on a project that consists of a shared library and a few application, and I already have one project in my solution for each of those. However, during development I find it useful to write small example programs that can run one small subsystem in isolation (at a level that doesn't belong in the unit tests).
Is there a good way to handle this in Visual Studio? I'd like to avoid adding several dozen separate projects to my solution for each small test program I write, especially when these programs will typically be less than 100 lines of code. I'm hoping to find something that lets me continue to work in Visual Studio and use its build system (rather than moving to something like NAnt).
I could foresee the answer being something like:
Upvotes: 0
Views: 672
Reputation: 255
I find myself using LinqPad in this kind of situation. I can link to the application exe/dlls and then run test code that references the project/solution components.
I find it far easier using mess around using that to write a little bit of code can reference the project but which doesn't have to be part of the permanent code base.
Upvotes: 1
Reputation: 37084
One project - one output. Simple. No way around it.
Use unit tests for snippet compilation.
Upvotes: 0
Reputation: 150108
Rather than write small test programs, consider writing unit tests. That leads you directly in to Test Driven Development.
You can have as many unit tests in a test project as you need.
Upvotes: 2