I have a nuget package, in it I have a method which has optional args (v1.0)
public void MyMethod(int a = 0){}
I later created a new version of my package with another optional arg (thinking it wasnt a breaking change) (v1.1)
public void MyMethod(int a = 0, int b = 1){}
This package is consumed by another nuget package which references v1.0 I have both v1.1 and the other nuget package included in my project. This means that at a binding level Im using v1.1 and the package using v1.0 is redirecting to the 1.1 dll.
This causes a missing method exception because of the following: https://stackoverflow.com/a/9884700/1070291
I want to fix my library so that either signature will function, my first thought was this:
public void MyMethod(int a = 0, int b = 1){}
public void MyMethod(int a = 0){ MyMethod(a,1); }
However this causes an ambiguous method when its used elsewhere.
I'm wondering if there is some way to fill in the old method for backward compatibility without creating something ambiguous going forward.
I almost want to mark the old signature with something to instruct the compiler to include this in the assembly but not link any new methods to it.