locked
Web server 'System.EnterpriseServices' could not load file or assembly RRS feed

  • Question

  • User1796694561 posted

    Hi members/experts,

    Hope that anyone can help/advice on the below case. Appreciate for ur help.

    I faced an error which is as below when i put in all my files into the web server, the page canot display.

    However when i run in local there is not a problem the page is able to display/run properly.

    Could not load file or assembly 'System.EnterpriseServices' or one of its dependencies. An attempt was made to load a program with an incorrect format.

    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.BadImageFormatException: Could not load file or assembly 'System.EnterpriseServices' or one of its dependencies. An attempt was made to load a program with an incorrect format.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.EnterpriseServices' could not be loaded.

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
    

    Stack Trace:

    [BadImageFormatException: Could not load file or assembly 'System.EnterpriseServices' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
       System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
       System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +416
       System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +166
       System.Reflection.Assembly.Load(String assemblyString) +35
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +190
    
    [ConfigurationErrorsException: Could not load file or assembly 'System.EnterpriseServices' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11326360
       System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +388
       System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +232
       System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +48
       System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +210
       System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +76
       System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +11315538
       System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +185
       System.Web.Compilation.BuildManager.CompileCodeDirectories() +654
       System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +658
    
    [HttpException (0x80004005): Could not load file or assembly 'System.EnterpriseServices' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
       System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +76
       System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +1012
       System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +1025
    
    [HttpException (0x80004005): Could not load file or assembly 'System.EnterpriseServices' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11420358
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4405140
    

    Version Information: Microsoft .NET Framework Version:2.0.50727.5477; ASP.NET Version:2.0.50727.5483

    Thanks.

    Thursday, May 22, 2014 8:52 PM

Answers

  • User1796694561 posted

    Thanks CASPartan,

    I've found the solution is the 32bit Application, have to put it as True

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 23, 2014 1:40 AM

All replies

  • User-1416423428 posted

    Version Information: Microsoft .NET Framework Version:2.0.50727.5477; ASP.NET Version:2.0.50727.5483

    You should setup IIS to be .NET Framework 4.0 at least. 

    Thursday, May 22, 2014 9:22 PM
  • User1796694561 posted

    Hi CASPartan,

    Sorry I'm a beginner in this, can you please explain in details?

    As my website is build using .net Framework2.0 so the setup u mean is the web server . net Framework?

    If I'm not wrong the web server framework for the webserver is .net3.5 will that work? or I will have to rebuild my website using .net4.0?

    Appreciate for your help

    Thursday, May 22, 2014 9:30 PM
  • User-1416423428 posted

    Under Application Pool (IIS Manager), the .NET Framework version for your website pool should be set to v4.0.  

    Double-click your Application Pool, and change the .NET framework version to .NET Framework v4.0.3xxxxx

    I think ASP.NET WebPages require v4.0 

    Thursday, May 22, 2014 9:38 PM
  • User1796694561 posted

    Thanks CASPartan,

    I've found the solution is the 32bit Application, have to put it as True

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 23, 2014 1:40 AM