Deploying to a prod server

Apr 16, 2011 at 10:53 AM

Has anyone had any problems deploying to another server?

I have it .dll working as I want on my local enviroment however when I try deploying I get an error

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

[BadImageFormatException: Could not load file or assembly 'MailChimp' or one of its dependencies. An attempt was made to load a program with an incorrect format.] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +567 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +192 System.Reflection.Assembly.Load(String assemblyString) +35 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +118 [ConfigurationErrorsException: Could not load file or assembly 'MailChimp' 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) +11396867 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +484 System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +127 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +334 System.Web.Compilation.BuildManager.CallPreStartInitMethods() +280 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1087 [HttpException (0x80004005): Could not load file or assembly 'MailChimp' or one of its dependencies. An attempt was made to load a program with an incorrect format.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11529072 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4784373

 

I have checked the bin and I can see that mailchimp.dll is in the bin.

 

Does anyone have a suggestion why this isnt working?

Coordinator
Apr 16, 2011 at 12:23 PM
Edited Apr 16, 2011 at 12:23 PM

Look at the previous discussion: http://mcapinet.codeplex.com/discussions/253604

It may help

Apr 16, 2011 at 8:35 PM

Hi denisk,

Yes I had already added the fsharp reference to my web.config. Am I meant to be doing the same with the mailchimp dll?

Coordinator
Apr 16, 2011 at 9:25 PM
Edited Apr 16, 2011 at 9:30 PM

1) Is your machine running 64-bit OS? (Try to enable 32-bit applications in IIS)

2) Which ,NET version is installed there? (Try to recompile the library under that version)

Apr 16, 2011 at 10:08 PM

Hi again,

My dev machine is running windows 7 x64 and the prod server is 2008 r2 x64. Both enviroments are running .net 4 mvc3

Coordinator
Apr 17, 2011 at 9:08 AM

The dll was compiled under x86 settings (my VS's default config).

Changed it to "Any CPU" - so now it should work in your prod server.  In any case U can always enable 32-bit applications in IIS.