Puppeteer-sharp-extra icon indicating copy to clipboard operation
Puppeteer-sharp-extra copied to clipboard

The host is disposed and cannot be used. Object name: 'LoggerFactory'.

Open skafaliev-dev opened this issue 4 years ago • 2 comments

Hello, thank you for this package.

There is some issue when I try to use it with Azure function v3 and netcoreapp3.1. Here is my .csproj file.

<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> <AzureFunctionsVersion>v3</AzureFunctionsVersion> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.11" /> <PackageReference Include="PuppeteerExtraSharp" Version="1.2.0" /> <PackageReference Include="PuppeteerSharp" Version="2.0.4" /> </ItemGroup> <ItemGroup> <None Update="host.json"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> <None Update="local.settings.json"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToPublishDirectory>Never</CopyToPublishDirectory> </None> </ItemGroup> </Project> The error is: Microsoft.Azure.WebJobs.Script.WebHost: The host is disposed and cannot be used. Disposed object: 'Microsoft.Azure.WebJobs.Script.WebHost.ScriptLoggerFactory'. Microsoft.Extensions.Logging: Cannot access a disposed object. Object name: 'LoggerFactory'. and it happens once code returns.

When I user only PuppeteerSharp , everything is fine.

skafaliev-dev avatar Jan 16 '21 14:01 skafaliev-dev

Hello, thanks for your feedback. I'm really busy with work right now, but I will try to fix it as soon as possible.

Overmiind avatar Jan 16 '21 16:01 Overmiind

I'm sorry to have kept you waiting. How are you using puppeteer with Azure? As I know there are 2 ways: SaaS like browserless.io or docker. Сould you send me a test project if you got one?

Overmiind avatar Feb 04 '21 12:02 Overmiind