locked
CRM 4.0 Internet Facing ("Could not load file or assembly 'Microsoft.Crm.Setup.Common.Interop.......") RRS feed

  • Question

  • Hi all,

    I'm trying to allow internet access to a Microsoft Dynamics CRM 4.0 instance on a server. CRM is installed, and I've created an IIS Web site which points to the "C:\Program Files\Microsoft Dynamics CRM\CRMWeb" folder. I have a subdomain, e.g. subdom.mydomain.com, which resolves correctly to the folder. CRM is working nicely inside the network, e.g. http://mycrm/, but when I navigate to, e.g. subdom.mydomain.com, I see...

    Server Error in '/' Application.

    Could not load file or assembly 'Microsoft.Crm.Setup.Common.Interop, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 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 'Microsoft.Crm.Setup.Common.Interop, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 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.

    Stack Trace: 
    [BadImageFormatException: Could not load file or assembly 'Microsoft.Crm.Setup.Common.Interop, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 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.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
       System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
       System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
       System.Reflection.Assembly.Load(String assemblyString) +28
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
    
    [ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Crm.Setup.Common.Interop, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 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) +613
       System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203
       System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105
       System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
       System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54
       System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +232
       System.Web.Compilation.BuildManager.CompileGlobalAsax() +51
       System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +337
    
    [HttpException (0x80004005): Could not load file or assembly 'Microsoft.Crm.Setup.Common.Interop, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
       System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58
       System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512
       System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729
    
    [HttpException (0x80004005): Could not load file or assembly 'Microsoft.Crm.Setup.Common.Interop, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8985939
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
       System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259

    (In case my paste isn't working, the key error message is..."Could not load file or assembly 'Microsoft.Crm.Setup.Common.Interop, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. An attempt was made to load a program with an incorrect format."

    I've had a look around the Web for solutions but I've been unsuccessful. It appears to be a DLL reference/assembly issue but I'm not so sure. I've explored Report / ReportServer solutions, using the IFD tool, and a few other things.

    Can anyone shed any light?

    Many thanks,

    Chris

    Thursday, January 2, 2014 6:41 AM