tags:

views:

323

answers:

3

Hi,

I have a c# .NET 2.0 application that has been running on W2K/IIS5 quite happily for several years. The sysadmin team are currently setting up a W2K3 box for the app, using the same install files, but are running into the dreaded "Could not load type..." error. The type in question is the class (i.e. code behind) for the page being requested.

I've read that switching the .NET version to 1.1 and back to 2.0 can fix the problem, but we've tried this with no luck.

Any ideas? Most of the info I can find is about solving the problem when it happens during development, running the app from Visual Studio.

Thanks, Jon.

A: 

Exception type: HttpParseException
Exception message: Could not load type 'CSP.Website.Public.Logon'.

Stack trace: at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.ParseInternal() at System.Web.UI.TemplateParser.Parse() at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

LordSauce
A: 

I think I had this before and it required either permissions changing in the application folder or resetting the IIS web application folder settings.

Reading your error message, I think another cause we found was when the JIT tried to compile the page, it didn't have permissions to the temporary folder.

Cade Roux
+1  A: 

Your best bet for finding out why an assembly isn't loading is the Assembly Binding Log Viewer. http://msdn.microsoft.com/en-us/library/e74a18c4(VS.71).aspx