我有.NET MVC应用程序(.NET Framework4.6.1),我想在我的应用程序中添加ClearScript。我通过NuGet添加了软件包NuGet,在启动应用程序之后,我出现了错误:
Could not load file or assembly 'file:///D:\PathToProject\bin\ClearScriptV8.win-x64.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
此文件位于bin
文件夹中。
我做错了什么?我该如何解决这个问题呢?
更新
下一步,我按照@BitCortex的建议,将程序集移到web.config文件中:
<system.web>
<compilation>
<assemblies>
<remove assembly="ClearScriptV8.win-x64" />
<remove assembly="ClearScriptV8.win-x86" />
</assemblies>
</compilation>
</system.web>
但没什么用。
结果,我将这些字符串注释到.csproj
文件中:
<Import Project="..\packages\Microsoft.ClearScript.V8.Native.win-x86.7.2.5\build\Microsoft.ClearScript.V8.Native.win-x86.props" Condition="Exists('..\packages\Microsoft.ClearScript.V8.Native.win-x86.7.2.5\build\Microsoft.ClearScript.V8.Native.win-x86.props')" />
<Import Project="..\packages\Microsoft.ClearScript.V8.Native.win-x64.7.2.5\build\Microsoft.ClearScript.V8.Native.win-x64.props" Condition="Exists('..\packages\Microsoft.ClearScript.V8.Native.win-x64.7.2.5\build\Microsoft.ClearScript.V8.Native.win-x64.props')" />
<Import Project="..\packages\Microsoft.ClearScript.V8.ICUData.7.2.5\build\Microsoft.ClearScript.V8.ICUData.props" Condition="Exists('..\packages\Microsoft.ClearScript.V8.ICUData.7.2.5\build\Microsoft.ClearScript.V8.ICUData.props')" />
现在,初始问题已经修复,但在执行脚本期间,我看到了以下错误:
Cannot load ClearScript V8 library. Load failure information for ClearScriptV8.win-x64.dll:
C:\Users\User\AppData\Local\Temp\Temporary ASP.NET Files\vs\...\runtimes\win-x64\native\ClearScriptV8.win-x64.dll: The specified module could not be found
C:\Users\User\AppData\Local\Temp\Temporary ASP.NET Files\vs\...\ClearScriptV8.win-x64.dll: The specified module could not be found
D:\pathtoproject\ClearScriptV8.win-x64.dll: The specified module could not be found
D:\pathtoproject\bin\ClearScriptV8.win-x64.dll: The specified module could not be found
C:\WINDOWS\system32\ClearScriptV8.win-x64.dll: The specified module could not be found'
我做错了什么?我该如何解决这个问题呢?
最初发行的assembly manifest
是什么?也许.xml
文件丢失到包文件夹或者其他什么地方了?(因为我在bin
文件夹中看到,例如ClearScript.V8.dll
和ClearScript.V8.xml
文件)
发布于 2022-05-06 15:42:55
通过将以下内容合并到所有Web.config文件中,尝试将ClearScript的本机程序集排除在编译之外:
<system.web>
<compilation>
<assemblies>
<remove assembly="ClearScriptV8.win-x64" />
<remove assembly="ClearScriptV8.win-x86" />
</assemblies>
</compilation>
</system.web>
https://stackoverflow.com/questions/72142705
复制相似问题