IIS 6, ASP.Net 1.1, TypeLoadException

H

haroldsphsu

Hi all,

My machine is a Windows 2003 Server R2 Standard Edition with SP1. I
have several web apps that needs to run in ASP.Net 1.1, and another
that needs to run in ASP.Net 2.0. I've created an additional
application pool for the apps that need to run ASP.Net 1.1. But when
I try to load the application, I get the following exception in the
event log:

Exception: System.TypeLoadException
Message: Could not load type 'System.Web.Hosting.HostingEnvironment'
from assembly 'System.Web, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'.
StackTrace: at System.Reflection.Assembly.GetType(String name,
Boolean throwOnError, Boolean ignoreCase)
at System.Activator.CreateInstance(String assemblyName, String
typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder,
Object[] args, CultureInfo culture, Object[] activationAttributes,
Evidence securityInfo, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(String assemblyName, String
typeName)
at System.AppDomain.CreateInstance(String assemblyName, String
typeName)
at System.AppDomain.CreateInstance(String assemblyName, String
typeName)
at
System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String
appId, IApplicationHost appHost, HostingEnvironmentParameters
hostingParameters)
at
System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(String
appId, IApplicationHost appHost, HostingEnvironmentParameters
hostingParameters)


System.Web.Hosting.HostingEnvironment is a type that's only available
in .Net 2.0. I'm not sure why, even when my virtual directory is
configured to run ASP.Net 1.1, it still tries to load that class.

I've tried uninstalling all ASP.Net versions with aspnet_regiis -ua,
then re-register both 1.1 and 2.0, set the versions accordingly on
each virtual dir, but still no luck.

I have a similar environment in my VM and I have no problem running
the apps in ASP.Net 1.1.

I'm not sure what I did wrong. Any help will be appreciated!

Thanks,
Harold
 
H

haroldsphsu

Turns out someone changed the registry on the server to always use the
latest version of CLR:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\OnlyUseLatestCLR

Changing it's value back to zero fixes the problem.

Harold
 

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

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top