473,756 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

AppDomainUnload ed Exception (Q309684) occurring without any unmanaged code involved

Hey everyone,

I have an issue that requires an urgent solution. I had a look at the
Technote above, and it states that the AppDomainUnload ed Exception
occurs with ASP.NET when using Managed C++ extensions as a wrapper to
Unmanaged C++ calls.

I am, however, seeing a similar problem with ASP.NET and my remoting
Managed VC++ .NET components. However, my remoted VC++ .NET
components do not call any Unmanaged code whatsoever.

My project consists of a singleton C++ .NET remoted object that is
first instantiated by a Windows Service (also created in VC++.NET).
This singleton provides access to other remoted objects that form a
business objects layer. ASP.NET then uses remoting to access the
singleton and any subsequent objects. Now, Everything works fine for
awhile, but randomly, I keep getting the AppDomainUnload edException
whenever the ASP.NET pages try to access some of the remoted objects.
Now, I did add the following to each type of remoted .NET Components
to make sure that it has an infinite lifetime:

Object *InitializeLife timeService()
{
return 0;
}

but the problem still seems to occur. My business objects exposed by
the singleton use ADO.NET to access an MSDE Database. The annoying
part is that the objects can be up for 5 minutes or an hour, the
occurrance of the Exception is totally random. The workaround
presented in the KBASE article is not a solution, as we have multiple
ASP.NET Web Apps hosted on this server.

Any help would be greatly appreciated, and my thanks in advance!
Nov 17 '05 #1
1 1278
oh, and just to mention, I am using VS.NET 2003 with the latest framework

ha************@ creo.com (Hamad Deshmukh) wrote in message news:<91******* *************** ***@posting.goo gle.com>...
Hey everyone,

I have an issue that requires an urgent solution. I had a look at the
Technote above, and it states that the AppDomainUnload ed Exception
occurs with ASP.NET when using Managed C++ extensions as a wrapper to
Unmanaged C++ calls.

I am, however, seeing a similar problem with ASP.NET and my remoting
Managed VC++ .NET components. However, my remoted VC++ .NET
components do not call any Unmanaged code whatsoever.

My project consists of a singleton C++ .NET remoted object that is
first instantiated by a Windows Service (also created in VC++.NET).
This singleton provides access to other remoted objects that form a
business objects layer. ASP.NET then uses remoting to access the
singleton and any subsequent objects. Now, Everything works fine for
awhile, but randomly, I keep getting the AppDomainUnload edException
whenever the ASP.NET pages try to access some of the remoted objects.
Now, I did add the following to each type of remoted .NET Components
to make sure that it has an infinite lifetime:

Object *InitializeLife timeService()
{
return 0;
}

but the problem still seems to occur. My business objects exposed by
the singleton use ADO.NET to access an MSDE Database. The annoying
part is that the objects can be up for 5 minutes or an hour, the
occurrance of the Exception is totally random. The workaround
presented in the KBASE article is not a solution, as we have multiple
ASP.NET Web Apps hosted on this server.

Any help would be greatly appreciated, and my thanks in advance!

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2060
by: Monster | last post by:
Are they expensive because of what happens when an exception is thrown or because of the extra checking involved when you wrap exceptions around code?
2
2612
by: Bret Pehrson | last post by:
Suppose the following: // Unmanaged code class UnmanagedException /* not visible outside of unmanaged code */ { }; void DoSomething() /* visible (exported) to managed code */ { throw new UnmangedException(); }
0
2064
by: Joe | last post by:
Reposting here as there were no useful replies in the dotnet.framework NG... What is the correct pattern for handling exceptions in IDisposable.Dispose, especially in a class that manages multiple unmanaged resources? An example of such a class is System.ComponentModel.Container. I have always understood that the IDisposable contract was that Dispose guarantees to release unmanaged resources owned by the object - even if the Dispose...
0
899
by: | last post by:
Hi, Does anyone know whether this bug related to AppDomainUnloaded exception and managed c++ has been fixed in VS.NET 2003 and framework 1.1? http://support.microsoft.com/default.aspx?scid=kb;en- us;309694 Thanks
5
2704
by: Peter Steele | last post by:
We have an application that when it runs in the IDE in debug mode an unhandled exception is occurring in a system header file associated with STL stirngs. The actual statement that crashes is return ::memcmp(_First1, _First2, _Count); On inspecting these variables, the strings are in fact equal when the exception occurs and _Count is the right size. As a test I replaced this code in the system include file with a for loop to do the...
1
1260
by: Bruce | last post by:
I am using VC .NET 2003. I created a simple unmanaged class in C++. The class is contained in a library. I then created a simple managed class wrapper that calls a function in the unmanaged class. I am getting a System.NullReferenceException when instantiating the unmanaged class. What is causing this error? Unmanaged code:
14
3788
by: Mohamed Mansour | last post by:
Hey there, this will be somewhat a long post, but any response is appreciated! I have done many PInvoke in the past from C++ to C#, but I did PInvoke within C# not C++/CLI. Can someone explain more why C++/CLI would be better to PInvoke than doing the PInvoke in C#? Because, usually in C# as you already know we use DLLImport and extern
1
8104
by: tk121 | last post by:
Hey all - I have some unmanaged code that I'm calling into with C# .NET 2.0, and everything works flawlessly in the debugger, but as soon as I run the application as a standalone executable it unexpectedly quits without throwing any exceptions. Even if I start the executable in the debugger it works okay. To see the failure, I need to start the application and then attach the debugger to the process. The function call will work okay twice...
4
2232
by: =?Utf-8?B?dmlwZXJ4MTk2Nw==?= | last post by:
We are having an issue with an application we are developing. We have a Legacy COM DLL in C++ that we have converted to Visual Studio 2008. This COM DLL has methods that are calling Managed C# assemblies as pass thru to support legacy applications in an effort to move our code to the new Code base. Our COM Object can be instantiated on Windows XP in any COM supported environment using Visual C++, Visual Basic, ASP.NET or ASP and works...
0
9456
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10040
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7248
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3806
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.