Recommended number of projects in Visual Studio Solution

I’ve worked on products on both extremes: one with ~100 projects in a single solution, and one with >20 solutions, of 4-5 projects each (Test, Business Layer, API, etc). Each approach has its advantages and disadvantages. A single solution is very useful when making changes – its easier to work with dependencies, and allows refactoring … Read more

How do I build a solution programmatically in C#?

See .NET 4.0 MSBuild API introduction for an example using the .NET 4.0 MSBuild API: List<ILogger> loggers = new List<ILogger>(); loggers.Add(new ConsoleLogger()); var projectCollection = new ProjectCollection(); projectCollection.RegisterLoggers(loggers); var project = projectCollection.LoadProject(buildFileUri); // Needs a reference to System.Xml try { project.Build(); } finally { projectCollection.UnregisterAllLoggers(); } A simpler example: var project = new Project(buildFileUri, null, … Read more

How to force a Solution file (SLN) to be opened in Visual Studio 2013?

The .sln file indicates the intended version as one of the early lines – for example: Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 or: Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 However – it can only make use of this if the default application for … Read more

Setting up a common nuget packages folder for all solutions when some projects are included in multiple solutions

I have a similar situation with external and internal package sources with projects referenced in more than one solution. I just got this working with one of our code bases today and it seems to be working with the developer workstations and our build server. The below process has this scenario in mind (although it … Read more

Analog of Visual Studio Solution for my application

If you need to build a series of Visual Studio solutions, then you need a build tool. The two most commonly used in the .NET world are MSBuild (reference: http://msdn.microsoft.com/en-us/library/dd393574.aspx) Nant (reference: http://nant.sourceforge.net/) (It’s not clear what you’re asking, you may wish to clarify or give an example.)