I'm struggling with proper dependencies versioning on releases. I've read in some articles that every change to AssemblyVersion in a library will cause the need of rebuilding all assemblies referencing this library. If it's true I need to be super careful when designing release cycles of dependent assemblies, right?
I wanted to verify the thesis by myself and... well, I noticed it is not the truth at all.
I made a console app which referenced dep1.dll (assembly version 1.0.0.0) and built it. Then I changed dep1.dll to version 2.0.0.0, built it and swapped it with version 1.0.0.0. When running console application I expected error "The assembly dep1.dll with version 1.0.0.0 couldn't be found". And you know what? Nothing special happened, the app used the library like it was targetting that version since the beginning.
ConsoleApp1/Program.cs
using dep1;
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
var a = new Class1();
a.Prop1 = "asdf";
Console.WriteLine(a.Prop1);
}
}
public class Implementation : Interface1
{
public int Super { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
}
}
dep1/Class1.cs
namespace dep1
{
public class Class1
{
public string Prop1 { get; set; }
}
public interface Interface1
{
int Super { get; set; }
}
}
As you can see, it's the same with interfaces.
Could you please explain why my test didn't work? This, other SO answers (1) and article by haacked on versioning interfaces really confused me.