This project has moved. For the latest updates, please go here.

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

Coordinator
Aug 4, 2015 at 1:43 PM
Subrata Biswas writes:

Hi,
I am getting "Could not load file or assembly 'ClearScriptV8-32' or one of its dependencies. An attempt was made to load a program with an incorrect format." exception while using ClearScriptV8 for our web server.
I have tried with installing Visual C++ Redistributable for Visual Studio 2012 Update 4 and other versions but the issue is not resolved. Is there any other workaround for it. I am using the latest version of the dll.
Call Stack:
[FileNotFoundException: Could not load file or assembly 'ClearScriptV8-64.DLL' or one of its dependencies. The specified module could not be found.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +210
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +242
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +17
System.Reflection.Assembly.Load(String assemblyString) +35
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +122

[ConfigurationErrorsException: Could not load file or assembly 'ClearScriptV8-64.DLL' or one of its dependencies. The specified module could not be found.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +12495956
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +499
System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +131
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +331
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +148
System.Web.Compilation.BuildManager.ExecutePreAppStart() +172
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1151

[HttpException (0x80004005): Could not load file or assembly 'ClearScriptV8-64.DLL' or one of its dependencies. The specified module could not be found.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12617668
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12457285

Thanks,
Subrata Biswas
Coordinator
Aug 4, 2015 at 3:05 PM
Edited Aug 4, 2015 at 3:08 PM
Hello Subrata!

Sorry, a few things aren't clear from the information you provided:
  1. Is your application 32-bit or 64-bit?
  2. Where are the following assemblies stored, relative to your application's root directory: ClearScriptV8-32.dll, ClearScriptV8-64.dll, v8-ia32.dll, v8-x64.dll?
  3. Have you set the "Copy to Output Directory" property for these files to "Do not copy"?
  4. Are you deploying a debug ClearScript build?
  5. Have you installed Visual C++ Redistributable Packages for Visual Studio 2013?
Also, if you haven't done so, please see Section IV ("Integrating and deploying ClearScript with your application") in the ClearScript ReadMe.

Thanks!
Aug 4, 2015 at 3:19 PM
Hi,
  1. My application is 64 bit and it works fine with ClearScript.dll
  2. ClearScriptV8-64.dll, v8-x64.dll are stored in the application's directory. Which looks correct to me as I stored ClearScript.dll at the same location and it worked.
  3. Yes, I have set Do not copy.
  4. Yeah I am deploying debug build.
  5. I have installed Visual C++ Redistributable Packages for Visual Studio 2013.
    and I have used signed dll for these dlls.
Do you have Microsoft internal distribution list or developer group?

Thanks,
Subrata Biswas
Coordinator
Aug 4, 2015 at 4:08 PM
Hi again,

1.My application is 64 bit and it works fine with ClearScript.dll

Your original message mentions an initial problem loading ClearScriptV8-32, which is a 32-bit assembly. If you're seeing that in a 64-bit app, please make sure that no ClearScript or V8 assemblies appear in your application's bin directory.

ClearScriptV8-64.dll, v8-x64.dll are stored in the application's directory. Which looks correct to me as I stored ClearScript.dll at the same location and it worked.

Your file placement seems correct, but what do you mean "it worked"? Please describe the scenario that isn't working.

Yeah I am deploying debug build.

If you're deploying a debug build of ClearScript, you'll have to install the debug Visual C++ runtime libraries, which are not redistributable. See the directory VC\Redist\Debug_NonRedist in your Visual Studio installation directory.

Do you have Microsoft internal distribution list or developer group?

This is the best place for discussing ClearScript, but you can also send email to ClearScript@microsoft.com.

Cheers!
Aug 17, 2015 at 1:12 PM
If you application is 64-bit - remove 32-bit version!