I had the same issue. In my case, it was caused by the addition of an [optional argument][1].
So first you would have:
referencingAssembly:
referencedAssembly.DoStuff(firstArgument, secondArgument)
referencedAssembly:
public void DoStuff(string firstArgument, string secondArgument)
{
//stuff to do
}
Then you add an optional parameter to the method, but you don't provide that argument while calling it.
referencingAssembly:
referencedAssembly.DoStuff(firstArgument, secondArgument)//unchanged
referencedAssembly:
public void DoStuff(string firstArgument, string secondArgument, string thirdArgument = "default value")
{
//stuff to do
}
Locally, this will build and run fine since the newly build referencingAssembly.dll will have a reference to the DoStuff(string, string, string) method. But when you only deploy the changed referencedAssembly (thinking: the added argument was optional, and the referencingAssembly still works), the old version of referencingAssembly will throw a MethodNotFound since it seeks a method with the signature DoStuff(string, string), which is no longer present in the referencedAssembly since we added the extra (optional) argument.
A possible solution could be an overload:
referencedAssembly:
public void DoStuff(string firstArgument, string secondArgument)//original method
{
DoStuff(firstArgument, secondArgument, "default value")
}
public void DoStuff(string firstArgument, string secondArgument, string thirdArgument)//new overload of the method
{
//stuff to do
}
Or deploying the newly build referencingAssembly (which will refer to the method with signature DoStuff(string, string, string)).
[1]: https://msdn.microsoft.com/en-us/library/dd264739.aspx