I'm using version 5.5.5 via the Microsoft.ClearScript nuget package.
Every once in a while when I run my application (WPF Windows app) or run my unit tests, I would get the following exception:
System.TypeLoadException : Cannot load V8 interface assembly. Load failure information for v8-base-x64.dll:
C:\path_to_my_vs_solution\bin\Debug\v8-base-x64.dll: The specified module could not be found
Sure enough, when I check that folder the v8-*.dll files are not there. When I build the solution again, they then reappear. I use many other nuget packages, and none of them cause an issue like this.
The IDE used is Visual Studio Enterprise 2019, Version 16.2.3
Hi @bhaeussermann,
Unfortunately we can't reproduce your issue.
The Microsoft.ClearScript NuGet package adds a set of simple project items that copy the V8 assemblies to your output directory. You can see those items here.
The intermittent nature of your issue suggests a race condition between two or more conflicting packages. Are you by any chance also using a third-party NuGet package that contains ClearScript? Have your ever used such a package in this solution? Some packages add custom build steps that can interfere with other packages, and removing the package doesn't always remove the build steps.
Another possibility is that you might be encountering a Visual Studio issue. As you can see, our package relies entirely on Visual Studio functionality to keep those V8 assemblies in place and up to date.
We recommend that you make sure the correct items have been added to your solution, and check for any custom build steps that might be interfering with them.
Good luck!
Thank you for your prompt reply,
I just noticed that we are not on the latest version of ClearScript, but are still using 5.5.5.
However, as we are currently working towards a major release we will hold off of updating for now, but I made a note to update as soon as we can. In the meanwhile, I have set the MSBuild logging to a higher level and will have a look at the Build log when the issue occurs again.
I will let you guys know what happens after we鈥檝e updated if there are still issues.
I also had this problem in Visual Studio 16.3.10.
Yes, this does seem to be happening still even with the latest version of the package 5.6.0. In fact, it seems now I have to perform a Rebuild as opposed to just a regular build in order to see the dll's restored.
I will make sure to check the build log for clues when I see this happening again.
I saw this issue happening again and spotted in the build-log the files were deleted during the build by the IncrementalClean target, but they were never copied back again.
It looks like this is the issue discussed here. This is apparently a bug in msbuild. This thread gives some work-arounds to avoid the issue, but apparently the bug is fixed in msbuild 16.5 Preview 1, so we should eventually see this being fixed by a Visual Studio update.
Most helpful comment
I saw this issue happening again and spotted in the build-log the files were deleted during the build by the IncrementalClean target, but they were never copied back again.
It looks like this is the issue discussed here. This is apparently a bug in msbuild. This thread gives some work-arounds to avoid the issue, but apparently the bug is fixed in msbuild 16.5 Preview 1, so we should eventually see this being fixed by a Visual Studio update.