Don't know what to title this. But here's what I had experienced.
I had deployed an Asp.net web application using Publish option of VS 2013. This application is using a layered architecture and has BAL, DAL etc. After a day or two there was a minor change in BAL which was to be deployed. As the change was only in BAL so I just build that BAL project and deployed the DLL of BAL only (without Publishing the whole web application) into the bin of my web application, and some things started breaking with Method not found exception however method was there. The exceptions that I received is below.
Message: Exception has been thrown by the target of an invocation.
Stack Trace: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'System.Collections.Generic.List
1 BusinessLayer.Dealer.Dealer_BAL.SelectStoreList(Int32, System.Nullable
1, System.Nullable`1)'. at UserInterfaceLayer.DataViews.Dealer.DealerStore.Select(Int32 Mst_Dealer_Id, Int32 userId, Int32 userType) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) at System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at Telerik.Web.UI.GridTableView.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at Telerik.Web.UI.GridTableView.DataBind() at Telerik.Web.UI.RadGrid.DataBind() at Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) at Telerik.Web.UI.RadGrid.Rebind() at UserInterfaceLayer.UC.LeaseApplication.UC_PrimaryLeaseInfo.SetControlValue(V2 v2) at UserInterfaceLayer.AddLeaseApplication.TempLeaseAppBind(String TempLeaseId) at UserInterfaceLayer.AddLeaseApplication.Page_Load(Object sender, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Below is the snip from IL DASM, which shows the method does exist in that dll.
What is suspicious to me is that faded pink box, what's the difference between those solid pink box methods and the faded ones in image above?
To provide more info and recap one more time, In second time deployment:
I hadn't published the whole web application.
I had deployed just one BAL dll only.
The BAL dll that was deployed was build on a different machine than the whole application was build on previously. May be this could be the reason not sure.