Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find Microsoft Edge in location '' #174

Open
nicolasr75 opened this issue Nov 13, 2024 · 4 comments
Open

Could not find Microsoft Edge in location '' #174

nicolasr75 opened this issue Nov 13, 2024 · 4 comments
Assignees

Comments

@nicolasr75
Copy link

nicolasr75 commented Nov 13, 2024

I noticed with the newest version of ChromiumHtmlToPdfConsole that it doesn't work for me on Linux anymore.

The call to the Converter lib in private static void Convert(Options options) hardcodes the browser parameter as Browser.Edge. But I have Chromium installed on my Debian. The lib therefore tries to find Edge, fails and aborts with the message:

Could not find Microsoft Edge in location ''

I solved the problem by rebuilding with Browser.Chrome as the default value. Do you think there is a better solution?

Some ideas:

  • explicitly specify the browser parameter from the command line
  • add Browser.Any and let the program search for both (this would provide backward compatibility)
@Sicos1977
Copy link
Owner

Didn't I add a parameter that you can use to select if you want to use chrome or edge?

@Sicos1977
Copy link
Owner

Uhm ... seems I forgot that :-) --> https://github.com/Sicos1977/ChromiumHtmlToPdf/blob/master/ChromiumHtmlToPdfConsole/Options.cs

I will try to add an option this weekend and release a new console app, did not even know that there are people like you that use the console app. Most questions I always got was about the library itself :-)

@Sicos1977 Sicos1977 self-assigned this Nov 13, 2024
@nicolasr75
Copy link
Author

private static void Convert(Options options)
{
    var stopWatch = Stopwatch.StartNew();
    var pageSettings = GetPageSettings(options);

    using var converter = new Converter(options.ChromiumLocation, options.ChromiumUserProfile, _logger, browser: Browser.Edge);
    SetConverterSettings(converter, options);
    ...

This is the code that I am seeing. Do you mean the ChromiumLocation? The thing is that it is very handy to let CHTP search for the browser instead of me having to find out the location myself ;-)

@nicolasr75
Copy link
Author

nicolasr75 commented Nov 13, 2024

I will try to add an option this weekend and release a new console app, did not even know that there are people like you that use the console app. Most questions I always got was about the library itself :-)

Thanks! Yes, we thought about using the lib but to avoid issues because of the different release cycles of CHTP, .NET and ourselves we decided to use it standalone which worked quite well in recent years. I have even published it self-contained today to be independent of any .NET installation. Hard disk space is available so this saves me some trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants