Attempted to access an unloaded AppDomain

M

Matt Fausey

I've been plagued with an "Attempted to access an unloaded AppDomain" for
several months now. We have a .NET Email Component such that for some
ASP.NET customers that user our DLL will get this error occasionally. Our
DLL is strongly named, so I am confused as to how this could be happening.
It is a mixed-mode DLL implemented in managed C++ such that a thin managed
C++ wrapper surrounds the unmanaged C++ implementation. I've gone over every
piece of documentation and information on the Net that I can find about
creating managed wrappers around unmanaged types, and as far as I can see I
am doing everything correctly. To give you a flavor of what happens, here is
an example snippet of a customer's code:

Chilkat.Email email = new Chilkat.Email();
email.From = FromAddress;
email.AddTo("", Address);
email.Subject = Subject;
email.Body = Body;


The exception occurs when I set a value to the Body. The other statements
execute without issue. Also, when I dump "email" in the Command Window, I
get this:


{Chilkat.Email}
System.Object: {Chilkat.Email}
Body: <error: an exception of type: {System.AppDomainUnloadedException}
occurred>
Decrypted: false
EmailDate: {7/9/2003}
EncryptedBy: ""
FileDistList: ""
From: ""
FromAddress: ""
FromName: ""
HtmlCharset: "us-ascii"
LastError: ""
LocalDate: {7/9/2003}
m_email: 84812680
Mailer: "Chilkat Software Inc (http://www.chilkatsoft.com)"
NumAlternatives: 0
NumAttachedMessages: 0
NumAttachments: 0
NumBcc: 0
NumCC: 0
NumRelatedItems: 0
NumReplacePatterns: 0
NumTo: 0
OutlookDistList: ""
PlainTextCharset: "us-ascii"
RawHeader: "MIME-Version: 1.0\r\nDate: Wed, 09 Jul 2003
10:55:07 -0400\r\nMessage-ID:
<CHILKAT-MID-b18bc301-2589-4599-be87-d83d647ca053@blah>\r\nContent-Type:
text/plain; charset=\"us-ascii\"\r\nContent-Transfer-Encoding:
7bit\r\nX-Mailer: Chilkat Software Inc
(http://www.chilkatsoft.com)\r\nX-Priority: 3 (Normal)"
ReceivedEncrypted: false
ReceivedSigned: false
ReplyTo: ""
ReturnReceipt: false
SendEncrypted: false
SendSigned: false
SignaturesValid: false
SignedBy: ""
Size: <error: an exception of type: {System.AppDomainUnloadedException}
occurred>
Subject: ""
Uidl: ""


Note that Size and Body both return exceptions. Can you think of anything
that could possibly cause this? Any help would be much appreciated.

Best Regards,
Matt Fausey
Chilkat Software, Inc.
 
T

Tomas Restrepo \(MVP\)

Hi Matt,
I've been plagued with an "Attempted to access an unloaded AppDomain" for
several months now. We have a .NET Email Component such that for some
ASP.NET customers that user our DLL will get this error occasionally. Our
DLL is strongly named, so I am confused as to how this could be happening.
It is a mixed-mode DLL implemented in managed C++ such that a thin managed
C++ wrapper surrounds the unmanaged C++ implementation. I've gone over every
piece of documentation and information on the Net that I can find about
creating managed wrappers around unmanaged types, and as far as I can see I
am doing everything correctly. To give you a flavor of what happens, here is
an example snippet of a customer's code:


Seems like you're running into
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q309694
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top