Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

DotNetBrowser - Exceptions when Upgrading from V1 to V2

$
0
0

I recently started migrating from a working V1 version of DotNetBrowser from TeamDev, and I ran into multiple issues that have stumped me.

Previously all the Chromium binaries worked well together and were built into the NuGet package. The main downside was launching multiple instances of my application caused the User Directory to get re-used, so I addressed that issue years ago.

I received a new license key back in 2020 for V2, so I figured I'd finally get around to upgrading, since there's a ton of new things to work with now. I upgraded to the latest version, 2.24.1 at the time of this question.

I went through and overhauled all the conversions of Javascript calls/executions to use the new way of things, but the biggest hurdle so far has been just getting the engine to work.

In debug, it takes several minutes for the new EngineFactory.Create call to process. It seems that most of the time is possibly due to downloading or extracting the Chromium dlls. Half the time it returns "RPC call timed out." the other half the time the message says "Cannot perform this operation, because the object is already disposed." When it does work after multiple retries, it does eventually create an IEngine, but when trying to create an IProfile or an IBrowser directly it also hits an exception of "Cannot perform this operation because the connection to Chromium is closed."

Here's the offending snippet called in the constructor:

            string base_data_directory = @"C:\test";            string chromium_directory = base_data_directory + @"\chromium_dir";            EngineOptions engineOptions = new EngineOptions.Builder            {                ChromiumDirectory = base_data_directory,                CrashDumpDirectory = chromium_directory + @"\CrashDump\",                UserDataDirectory = chromium_directory + @"\User\",                SandboxDisabled = true            }.Build();            IEngine engine = EngineFactory.Create(engineOptions);

I don't have any additional instances running, and the initialization time is consistently multiple minutes before the exceptions occur.

After some digging, I read in one of their FAQs that their licenses are only valid for versions released while the license was valid. Although I didn't receive any of their license related exceptions, I figured I'd try to roll back, so I removed the new NuGet packages and installed 2.1.1, which was the last release that occurred during my license range.

The exception did change, but it changed to be "Unable to find or restore compatible Chromium binaries. The compatible binaries were not found in the assembly." and digging through NuGet, they don't seem to have a publicly released version 2.1.1 Chromium package.

Has anyone else experienced this issue? I would like to eventually get a new license key, but if the issues with launch time (which is an unacceptable increase in time) and the random RPC / dispose of the Engine while being created I probably will go back to version 1.


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>