Q:

C#: When is it worth specifying a BaseAddress in a project's properties?

I'm creating a C# Library project with .NET 4 framework (this is a new project in an existing solution, in Visual Studio 2012). I see that some older existing projects are specifying BaseAddress of the DLL in project properties, for example (from .csproj file):
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
  <DebugSymbols>true</DebugSymbols>
  <OutputPath>bin\x86\Debug\</OutputPath>
  <DefineConstants>TRACE;DEBUG</DefineConstants>
  <BaseAddress>285212672</BaseAddress>
  <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
  <PlatformTarget>x86</PlatformTarget>
</PropertyGroup>

I understand what the base address means, but my question is what the advantage is of specifying the BaseAddress of the DLL, and under what circumstances should I consider doing it for the new library project, as opposed to just letting the compiler choose it?

A:

To be clear, the compiler chooses some base address for your executable or library, but the operating system has the last word. In a modern project, there is no real advantage to specifying one. Back in the days, having a unique base address could speed up things a tiny bit when the executable was loaded. Now, with ASLR, it's always disregarded.

