Sep 21: Remoting Configuration Loaded Too Little Too Late
How strange... The program works perfectly in debug mode, but in release mode I get a TypeInitializationException. Why?
The exception originates at the construction of an object (BatchRunner) that tries to instantiate a remotable object. This remotable object is declared as a private static variable:
#region Private Static Fields
private static RemotingWrapper Wrapper = CreateRemotingWrapper();
#endregion
And herein lies the problem. The call to CreateRemotingWrapper() fires when the implicit static constuctor is called. In release mode the compiler makes certain optimizations that it does not make in debug mode. Apparently causing implicit static constructors to execute very, very early. Read More
The exception originates at the construction of an object (BatchRunner) that tries to instantiate a remotable object. This remotable object is declared as a private static variable:
#region Private Static Fields
private static RemotingWrapper Wrapper = CreateRemotingWrapper();
#endregion
And herein lies the problem. The call to CreateRemotingWrapper() fires when the implicit static constuctor is called. In release mode the compiler makes certain optimizations that it does not make in debug mode. Apparently causing implicit static constructors to execute very, very early. Read More
« previous page
(Page 1 of 1, totaling 1 entries)
next page »
