Error with eService site

Jul 19, 2010 at 8:09 AM

Hi.

I have installed the eService Accelerator and got to the stage of using the example site http://servername:4444 however when I navigate to that URL I get a server error...

 

Server Error in '/' Application.

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

[BadImageFormatException: Could not load file or assembly 'Microsoft.Crm.Sdk' 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 'Microsoft.Crm.Sdk' 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) +11207304
   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) +11196482
   System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +185
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +551

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Crm.Sdk' 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 'Microsoft.Crm.Sdk' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11301302
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +11174792


Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

Could someone help with this issue?

Thanks<!-- [BadImageFormatException]: Could not load file or assembly 'Microsoft.Crm.Sdk' or one of its dependencies. An attempt was made to load a program with an incorrect format. at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) [ConfigurationErrorsException]: Could not load file or assembly 'Microsoft.Crm.Sdk' or one of its dependencies. An attempt was made to load a program with an incorrect format. at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) at System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() at System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) at System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) at System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) at System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) at System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() [HttpException]: Could not load file or assembly 'Microsoft.Crm.Sdk' or one of its dependencies. An attempt was made to load a program with an incorrect format. at System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) [HttpException]: Could not load file or assembly 'Microsoft.Crm.Sdk' or one of its dependencies. An attempt was made to load a program with an incorrect format. at System.Web.HttpRuntime.FirstRequestInit(HttpContext context) at System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) --><!-- This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->

Jul 19, 2010 at 3:16 PM

This problem is likely due to you having the CRM outlook client installed on your developer workstation and deploying to a web server.  When you have the outlook client installed, it puts the microsoft.crm.sdk.dll file in the GAC, and Visual Studio sees it there and decides that you don't need to have the assembly included in the local bin folder for the website.  When you deploy it, it will be missing that assembly.  The easiest thing to do is to turn on the properties window, then select the assembly and change the attribute Copy Local to true.

Now that said, are you aware that the eService and Events accelerators have been updated and replaced with the new Customer Portal accelerator?  The code is much more modern, and all the functionality of both accelerators is in the new customer portal.  Finally, the customer portal is based on a CMS model, which allows you to adjust the content of the portal using a simple browser.  I would not recommend spending any time with the old accelerators.  see http://customerportal.codeplex.com for more information.

Shan McArthur
www.shanmcarthur.net

Jul 19, 2010 at 3:44 PM

Hi Shan

Thank you, I am not sure as I understand your first sentence, I installed this directly on the server and tried to open the site from the server, Outlook is not installed on the server so the Outlook client is not installed.

Anyway moving on, I did not realise about the new accelerator so my question is how do I remove the old accelerator from my server, it is a production server I was trying to install to so I don't have the luxury of scrapping the machine and starting again?

Thank you

David

Jul 19, 2010 at 3:46 PM

You don't really have to 'remove' the old accelerator.  You can keep the customizations as some of them are identical to the new accelerators.  You can delete the website that you set up and then reuse it for the new customer portal.

Shan

Aug 20, 2010 at 12:34 PM

Might be that you are using 32 bit assemblys on an 64 bit Server - the x64 Dll's are included in the SDK