# Assembly Versioning in SharpDevelop

## How the versions are set

The assemblyInfo.cs files are updated by the tool "UpdateAssemblyInfo". "UpdateAssemblyInfo Startup" runs as pre-compile target and always set's SharpDevelop.exe's revision to the subversion revision number. That number is displayed in the splash screen, error dialog and about dialog.

The libraries (Core, SharpDevelop, TextEditor, NRefactoring, Addins) however are a little different. Their assemblyinfos are not "templated" like the one in Startup, but directly included in the repository. However, we don't want to re-commit them on every commit. Therefore, the versioning is different.

"ReleaseBuild.bat" updates their AssemblyInfo, too; but the normal "build.bat" doesn't. In the repository, they are always included with the version number "2.0.0.1". When doing a releasebuild, this version is replaced by the major version from Startup + the subversion revision number. (That means if you want to change from "2.0.0.x" to "2.0.1.x", you only have to change Startup\AssemblyInfo.template)

If you now want to commit local repository changes, you have to revert the assembly infos back to "2.0.0.1" first. This is done by the file "resetAssemblyInfo.bat".

So in conclusion, the assemblies are versioned like this:

| Debug | Release
--- | --- | ---
SharpDevelop.exe | 2.x.y.r | 2.x.y.r
Libraries | 2.x.0.1 | 2.x.y.r

## Publisher Policy

While the assembly versioning schema is not so important inside SharpDevelop, it is important for 3rd party addins because the main libraries like ICSharpCode.Core are strong-named. Normally, an assembly compiled against a strong-named assembly can only be used with exactly the version of the library it was compiled with.

This means if a 3rd-party addin was compiled against version 2.0.1.a, it cannot bind to version 2.0.1.b or 2.0.2.c; even if it would run without problems. Therefore, SharpDevelop.exe.config contains binding redirects for the strong-named libraries that addins would want to reference.

The binding redirects always redirect from version 2.x.0.1 to the current version. That means 3rd-party addins must be compiled against a debug version of SharpDevelop (after executing "resetAssemblyInfo.bat") and they will bind to every SharpDevelop version (and if the classes used by the addin stayed binary compatible, it will even run with every SharpDevelop version).