C# Development

Dependency Management

Dependencies should ideally be managed with NuGet.

This is probably the best overview of working with NuGet. This third-party tutorial also looks like it might be good, but appears to be VS2017 specific.

Unfortunately it seems that VS10 and its version of NuGet are too out of date and a lot of packages can’t be installed.

Do not include packages directory in source control - packages should be retrieved fresh by NuGet by each developer.

An important change to how I have been operating is to install packages to projects, rather than to the solution and then creating the references manually.

PM> Install-Package Z.EntityFramework.Classic -ProjectName EFDemo

I have to assume that if you install a package to multiple projects it will just use the existing package.

To pull down referenced packages for a fresh checkout:

nuget restore

Configuration Management

A strategy for handling conflicting configuration and secrets in App.config and Web.config files.

Building

I haven’t found a good automated way to install the MS build tools. It seems like the latest MSBuild works ok for older projects, and can be installed with a GUI installer available here (“Build Tools for Visual Studio 2019”).

MSBuild does not get added to the system path. It is available here for referencing directly, or the bin directory can be added to the path:

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild