Reputation: 2835
I want to create a new project in C# using VS2010 and I wonder what's the best organization in this project. I have some experience with Maven and what I want here it's something that will be as organized as the Maven folder scheme. THe project it's an API client so my goals are:
What's the best approach in VS without using any thrid-party tool? I want to automatically deploy the client assembly without having the unit and main code and have the unit code also separated from the rest.
Upvotes: 0
Views: 845
Reputation: 9237
Scott Hanselman wrote a very good blog post on how his team organizes their code. It covers not only how their code is physically organized on the drive, but the thinking behind the organization.
Scott Hanselman's Computer Zen: How do your organize your code?
The post is now very old, but the approach that team uses would let you accomplish most, if not all of what you are trying to do. He also mentions some nice free tools for builds, testing, code coverage, and build visibility.
Upvotes: 1
Reputation: 2402
I could be misunderstanding your question - I don't have a lot of experience with API clients, but I'm wondering if what you're really after is a better understanding of solutions. A VS solution allows you to logically group multiple projects, giving you what you're looking for in option 4.
With that in mind, I'd have a single solution, and then a project for your requirements 1-3.
Sorry if that's way off base or over simplified.
Upvotes: 2
Reputation: 1768
Yup, so very much like Bobby explained, a solution allows you group multiple project which you can open from a single .sln file. A close analogy is something like an EAR project in eclipse although in eclipse you don't get to see a single file you click on to open only the projects in your solution.
So for your "solution", you can use an empty solution, add class library project for your API code, you can add a console application for your test project and add a reference to your API class library, you will put your test project in a separate class library for test which will also reference the API library.
For the kind of automated builds you get with maven, you can check out MSBUILD for starters.
Upvotes: 1