Article ID: 924731 - Last Review: December 3, 2007 - Revision: 1.2 Error message when you try to run a Web application that is built on the .NET Framework 2.0: "Unable to cast object"SYMPTOMSWhen you try to run a Web application that is built on the
Microsoft .NET Framework 2.0, you may receive an error message that resembles
the following: Server Error in '/appname' Application. "Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Util.ITypedWebObjectFactory'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Util.ITypedWebObjectFactory'." This problem occurs after you restart the Web application. Note This problem may continue to occur even after you use the iisreset command to reset Microsoft Internet Information Services (IIS). CAUSEThis problem is caused when a satellite assembly that has a
nonneutral culture is located directly in the Bin folder of the Web application. Satellite assemblies must be located
in a subfolder of the Bin folder. Additionally, satellite assemblies must have a name that is equal to the culture of the assembly,
such as en-GB. RESOLUTIONTo resolve this problem, move the satellite assembly that
has a nonneutral culture to a subfolder of the Bin folder. MORE INFORMATIONYou can determine whether a satellite assembly has a nonneutral culture
by considering the AssemblyCulture attribute of the assembly. For example, a satellite assembly that has a
specific culture contains an AssemblyCulture attribute that resembles the following.
| Article Translations
|

Back to the top
