I am building a .net application using managed C++.  I am encountered the
error message "Attempted to access an unloaded AppDomain".  I have
isolated this down and am able to reproduce this by doing the following:

#1) Generate a new project(vc++ managed c++ class library)
#2) to the c++ file add the following:
#include <string>
std::string fred;
  // yes no body is required, but even if you make one the same occurs.

Build the solution
Run regasm on the dll
I get a:
c:\NET PROJECTS\m6\Debug>regasm m6.dll
Microsoft (R) .NET Framework Assembly Registration Utility 1.0.3705.0
Copyright (C) Microsoft Corporation 1998-2001.  All rights reserved.

Types registered successfully

Unhandled Exception: System.AppDomainUnloadedException: Attempted to
access an u nloaded AppDomain.
   at __DllMainCRTStartup@12(Void* , UInt32 , Void* )

Note: adding "Using namespace std and removing the std from the string
declaration doesn't make any difference.  This compiles and links with no
errors and no warnings.  This message only appears when I use
Regasm programname.dll.


Any help or a workaround would be appreciated!
Thanks in advance,
David Bench

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to