Whether ASP.Net uses GAC to search for Missing Assemblies? RRS feed

  • Question

  • We are trying to consume a Assembly in a ASP.Net app.
    But we are getting an exception "BadImageFormatException".
    The same dll if it is loaded in a Desktop app works all fine.

    Our take is in a desktop app, the runtime checks for missing dlls from the GAC
    But not sure if it is the same for ASP.Net runtime.
    Can anyone help?
    Tuesday, December 3, 2013 6:16 AM


  • The GAC is always searched first so yes, you can say that ASP.NET and any other .NET application searches the GAC for missing assemblies.

    "But we are getting an exception "BadImageFormatException"."

    That sounds like a different issue. The assembly you're trying to load is probably intended to work in a 32 bit process. ASP.NET usually uses 64 bit so the assembly can't load. You'll need to find a version of the assembly that can work in a 64 bit process.

    Alternatively I think it's possible to make ASP.NET use a 32 bit process but that will limit the amount of memory the application can use. For more questions regarding ASP.NET please use the ASP.NET forums: http://forums.asp.net

    Tuesday, December 3, 2013 7:09 AM