The Jit compiler must load Dll B in order to check / verify the Supervise method.
Move calls in Dll B to another method and prevent this method from being embedded ( [MethodImpl(MethodImplOptions.NoInlining)] ). Otherwise, you may have strange effects switching from Debug to Release mode.
If I remember it correctly, inlining is not used for compiled Debug code, but the release code can embed the called method, putting a strain on the Dll B jitter before checking.
//only public method is this class // all calls to dll B must go in helper function public string Supervise(object projectGroup, out string msg) { //Checks for updates of dll B and downloads it if available. And fails. manageUpdate(); return SuperviseHelper(projectGroup, out msg); } [MethodImpl(MethodImplOptions.NoInlining)] public string SuperviseHelper(object projectGroup, out string msg) { //first instanciation of any class from dll B ReportEngine.ReportEngine engine = new ReportEngine.ReportEngine(); string result = engine.Supervise(projectGroup, out msg); return result; }
source share