2

The Error as far as I can tell is occurring at one of these line:

SomeClass foo = new SomeClass();
foo.getSomeStuff(id1,id2,id3, connectionString, UserName, Password, out html, out xml);

Here is what SomeClass basically looks like:

public class SomeClass
{
    private static System.AppDomain SomeDomain { get; set; }
    private static SomeUtility utility { get; set; }

    static SomeClass()
    {
        InitializeSomeClass();
    }


    private static void InitializeSomeClass()
    {
        //code here
        utility = (SomeUtility)SomeDomain.CreateInstanceAndUnwrap(Assembly.GetExecutingAssembly().FullName, "SomeUtility");
    }

    public void getSomeStuff(int id1, int id2, int id3, string connectionString, string UserName, string Password, out string html, out string xml)
    {
        html = xml = "";
        utility.ExtractContent(id1, id2, id3, connectionString, UserName, Password, out html, out xml);
    }

}

I misread the Code when translating it to more general terms. I have corrected it. Does this make anymore sense?

I have very little experience with Static Constructors, but I my instinct tells me the problem might lie somewhere in there.

DontThinkJustGo
  • 380
  • 2
  • 11

2 Answers2

0

In your sample code, the SomeDomain property has never been initialized when you execute the following line:

utility = (SomeUtility)SomeDomain.CreateInstanceAndUnwrap(...)

More generally, look at the stack trace and/or run under a debugger - you'll soon see which line is failing and why.

Joe
  • 122,218
  • 32
  • 205
  • 338
  • Wish I could run under a debugger. This is only happening on a client's server so best I can do is write Log statements to see where it's happening. The Log statements go dark at the line mentioned above. I can't get anything else to happen after SomeClass foo = new SomeClass(); – DontThinkJustGo Jan 07 '14 at 19:55
  • What does the stack trace say? can you get a logged copy of the stack trace when the exception is thrown? – Scott Chamberlain Jan 07 '14 at 20:18
0

I believe I found the issue. It is occurring in a 3rd party assembly in the section: "//code here". I didn't include the code earlier for security purposes, but I'll work with the 3rd party for resolution. Thanks all!

DontThinkJustGo
  • 380
  • 2
  • 11