I have an ASP.NET (C#) web application that loads my dll assembly during run time. It has always worked fine on windows server 2003, but now that we moved over to windows server 2012 I've been getting the error:
could not load file or assembly 'C:\\Inetpub\\wwwroot\\FrontOffice\\bin\\overlay\\FrontOffice.Edi.Overlay.FORD.dll' or one of its dependencies.
This is the code that I have:
AppDomain.CurrentDomain.AppendPrivatePath(AppDomain.CurrentDomain.BaseDirectory + "bin\\overlay");
Assembly.Load("FrontOffice.Edi.Overlay");
Assembly assembly = Assembly.Load("FrontOffice.Edi.Overlay." + tp);
AppDomain.CurrentDomain.ClearPrivatePath();
Type type = assembly.GetType("FrontOffice.Edi.Overlay." + tp + ".Overlay" + tp);
Object[] args = new object[] { hdrRow, ts };
Overlay = Activator.CreateInstance(type, args);
OverlayInfo = type.GetMethod("ProcessSegment");
The error is happening on the second line on Assembly.Load(....)
;
Any help would be appreciated.