문제

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.

도움이 되었습니까?

해결책 2

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!

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top