What happens (in terms of CLR) when the code on a classic ASP page creates an instance of .NET class (marked as ComVisible, type library is registered)?
What AppDomain is used for the newly created instance? Does it have anything to do with the AppDomain of the ASP.NET application running on the same site?
Each “application” (an asp.net or classic ASP site) in IIS runs in a win32 process, also known as an “application pool.” Each application pool (process) may have zero or one version of the CLR loaded* (1.0,1.1,2.0,4.0) loaded into the process simultaneously. Each CLR instance, within a process, has at least one Application Domain, the unit of execution and isolation for .NET. When you instantiate a .NET component via a CCW (COM-callable wrapper) from classic ASP, the CLR is loaded into the application pool process that hosts that site, and a default appdomain is created for that process. The logical position in the URL path hierarchy is irrelevant because different segments can have different application pools.
That probably is a lot to take in, but I suggest reading up on IIS/WAS architecture and the CLR’s process/appdomain/assembly relationships.
*The CLR 4.0 loader allows one or more versions of the CLR to be loaded into the same process