Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

IIS 6, ASP.Net 1.1, TypeLoadException

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
haroldsphsu@gmail.com - 02 Feb 2008 00:18 GMT
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
haroldsphsu@gmail.com - 05 Feb 2008 20:50 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.