First Call from .Net core 2 Web API works, next one hangs
See original GitHub issueI’m using this on Windows 10 with a .Net core 2 web api.
The first call works fine, but subsequent calls hang. Any ideas?
private byte[] GeneratePDFFromHtml(string html)
{
var converter = new SynchronizedConverter(new PdfTools());
var doc = new HtmlToPdfDocument()
{
GlobalSettings =
{
ColorMode = ColorMode.Color,
Orientation = Orientation.Landscape,
PaperSize = PaperKind.A4Plus
},
Objects =
{
new ObjectSettings()
{
PagesCount = true,
HtmlContent = html,
WebSettings =
{
DefaultEncoding = "utf-8"
},
HeaderSettings =
{
FontSize = 9,
Right = "Page [page] of [toPage]",
Line = true,
Spacing = 2.812
}
}
}
};
var bytes = converter.Convert(doc);
return bytes;
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
c# - .NET Web Api application hangs when calling other ...
The problem: when there are 3 or more clients calling the first service in parallel the calls to second service hangs. Here is...
Read more >NET Core 2.2 Web API Shuts down immediately after running
After a few times of this the code just stops running. I hit the IIS Express start button and it looks like it's...
Read more >ASP.NET Core Best Practices
ASP.NET Core apps perform best when architected to run code in parallel. Do not call Task.Run and immediately await it. ASP.NET Core already ......
Read more >Diagnosing an ASP.NET Core hard crash
The immediate crash was due to an exception being thrown in an async void method. Relevant threading aspects: I start the ASP.NET Core...
Read more >Configure the ASP.NET Core application to start ...
The ASP.NET Core application is configured to start automatically after the server restarts or if the process stops or crashes. Therefore, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this solution didn’t worked for me. I have declared singleton but still it stops at line var bytes = converter.Convert(doc); Please suggest.
You must declare SynchronizedConverter as singleton. Example with DI.