1

我用 ClearScript.V8 开始了一个项目。我正在使用 C# 在 Windows 10 和 Visual Studio 2015 上进行开发。Web 是 IISExpress,最终将在 Windows 2012 服务器上发布。我使用 NuGet 添加了包 ClearScript.V8 (v5.4.9)。我总是从一开始就收到下面的错误,甚至还没有初始化 ClearScript(是的,它是法语,但应该很容易理解):

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

描述 : 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 pour pour plus d'informations sur l'erreur et son origine dans le code。

异常的详细信息: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。

错误来源:

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

跟踪 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 for Introspection, Boolean suppressSecurityChecks) +36
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark & stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean for Introspection, Boolean suppressSecurityChecks) +152
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMarkString & , IntPtr pPrivHostBinder, Boolean for Introspection) +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, 异常 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

版本信息:Microsoft .NET Framework 版本:4.0.30319;版本 ASP.NET:4.7.2046.0

我按照https://microsoft.github.io/ClearScript/Details/Build.html(尤其是第四节)的说明进行操作,所以我有文件 ClearScript.dll、ClearScriptV8-32.dll、ClearScriptV8-64.dll、v8-ia32 .dll 和 v8-x64.dll 在我的 bin 文件夹中。我的根文件夹中也有 ClearScriptV8-32.dll 和 ClearScriptV8-64.dll(复制到输出 = 不要复制)。

我错过了什么?

4

1 回答 1

4

尝试将所有这些 DLL(ClearScriptV8-*.dll、v8-*.dll)放入根文件夹,确保在bin. 如果您要部署到没有 Visual Studio(或使用 Visual Studio 但没有 C++ 支持)的机器上,请安装适当版本的 Visual C++ Redistributable(它必须与用于构建 ClearScript 的编译器匹配)。

于 2017-06-28T12:42:41.077 回答