Call to SetAppDomainManagerType fails w/unknown HRESULT  
Author Message
Redburga





PostPosted: Common Language Runtime, Call to SetAppDomainManagerType fails w/unknown HRESULT Top

I'm trying to set my own AppDomainManager. I have Pratschner's book (and really wish he included the code for Boat Race in the downloads...kind of frustrating).

Anyway, when I call ICLRControl::SetAppDomainManagerType, I keep getting an undocumented HRESULT: -2146234334 (0x80131022). From CorError.h, I can see this is an executing engine error, but I don't know what it is.

I tried running the fusion log viewer to see if I could get an idea of what's going on, but that just locked up everything and I had to reboot my machine.

Can anyone at least tell me what the HRESULT means



.NET Development33  
 
 
Redburga





PostPosted: Common Language Runtime, Call to SetAppDomainManagerType fails w/unknown HRESULT Top

I figured the problems I was having with fuslogvw were because I had it trying to log everything. Maybe it would eventually finish after loading the CLR. It "hangs" at the ICLRRuntimeHost::Start call. I tried two other things, but didn't get anything logged. I was hoping I might get a log of what it was doing when it tries to load my assembly, but no luck.

Here's the code that returns the error. All my HRESULTS are OK until I get to the last statement. That's when I get the error.

ICLRRuntimeHost *pCLR = NULL;
HRESULT hr = CorBindToRuntimeEx( L"v2.0.50727", L"wks", STARTUP_CONCURRENT_GC, CLSID_CLRRuntimeHost, IID_ICLRRuntimeHost, (PVOID*) &pCLR
);

hr = pCLR->Start();
ICLRControl *pClrControl = NULL
;
hr = pCLR->GetCLRControl( &pClrControl
);
hr = pClrControl->SetAppDomainManagerType( L"MyDomainManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=756ecc254eab3c35", L"MyNamespace.MyDomainManager" );

 


 
 
Redburga





PostPosted: Common Language Runtime, Call to SetAppDomainManagerType fails w/unknown HRESULT Top

My AppDomainManager seems to work. I can successfully create it if I use the environment variable method:

[STAThread]
static void Main( string[] args )
{
ProcessStartInfo processInfo
= new ProcessStartInfo( );
processInfo
.EnvironmentVariables["APPDOMAIN_MANAGER_ASM"] = "MyDomainManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=756ecc254eab3c35";
processInfo
.EnvironmentVariables["APPDOMAIN_MANAGER_TYPE"] = "MyNamespace.MyDomainManager";
processInfo
.UseShellExecute = false;
Process.Start( processInfo );
}

This will probably let me get some testing done. However, in real life, I think I'll need to do it via C++. Can anyone tell me what the unknown HRESULT means Any help would be much appreciated!


 
 
Redburga





PostPosted: Common Language Runtime, Call to SetAppDomainManagerType fails w/unknown HRESULT Top

Thought I should follow up in case anyone else experiences this problem: I got in touch with Pratschner. There was a problem in his book. The call to Start must come after the call to SetAppDomainManagerType.