pdube
pdube

Reputation: 643

Cannot load assembly or dependencies with ClearScript.V8

I am started a project with ClearScript.V8. I am developing on Windows 10 & Visual Studio 2015 in C#. The web is IISExpress and this will eventually be released on a Windows 2012 server. I added the package ClearScript.V8 (v5.4.9) using NuGet. I always get the error below right from the start, not even initializing ClearScript yet (yes it's in french but it should be easy to understand):

Impossible de charger le fichier ou l'assembly 'ClearScriptV8-32.DLL' ou une de ses dépendances. Le module spécifié est introuvable.

Description : Une exception non gérée s'est produite au moment de l'exécution de la requête Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.

Détails de l'exception: System.IO.FileNotFoundException: Impossible de charger le fichier ou l'assembly 'ClearScriptV8-32.DLL' ou une de ses dépendances. Le module spécifié est introuvable.

Erreur source:

Une exception non gérée s'est produite lors de l'exécution de la requête Web actuelle. Les informations relatives à l'origine et l'emplacement de l'exception peuvent être identifiées en utilisant la trace de la pile d'exception ci-dessous.

Trace de la pile:

[FileNotFoundException: Impossible de charger le fichier ou l'assembly 'ClearScriptV8-32.DLL' ou une de ses dépendances. Le module spécifié est introuvable.]
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.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +36
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +21 System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38

[ConfigurationErrorsException: Impossible de charger le fichier ou l'assembly 'ClearScriptV8-32.DLL' ou une de ses dépendances. Le module spécifié est introuvable.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +738
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +92 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +290
System.Web.Compilation.BuildManager.ExecutePreAppStart() +157
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +549

[HttpException (0x80004005): Impossible de charger le fichier ou l'assembly 'ClearScriptV8-32.DLL' ou une de ses dépendances. Le module spécifié est introuvable.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10044576 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Informations sur la version : Version Microsoft .NET Framework :4.0.30319; Version ASP.NET :4.7.2046.0

I followed instructions from https://microsoft.github.io/ClearScript/Details/Build.html (especially section IV), so I have files ClearScript.dll, ClearScriptV8-32.dll, ClearScriptV8-64.dll, v8-ia32.dll and v8-x64.dll in my bin folder. I also have ClearScriptV8-32.dll and ClearScriptV8-64.dll in my root folder (with Copy to Output = Do not copy).

What am I missing?

Upvotes: 1

Views: 3351

Answers (1)

Andromedary
Andromedary

Reputation: 3548

Try putting all of those DLLs (ClearScriptV8-*.dll, v8-*.dll) into the root folder, and make sure you do not have copies in bin. And if you're deploying onto a machine without Visual Studio (or with Visual Studio but without C++ support), install the appropriate version of Visual C++ Redistributable (it has to match the compiler used to build ClearScript).

Upvotes: 4

Related Questions