Strumenta / SmartReader

SmartReader is a library to extract the main content of a web page, based on a port of the Readability library by Mozilla
https://smartreader.inre.me
Apache License 2.0
160 stars 36 forks source link

does it work on .NET Framework 4.6? #2

Closed yasindn closed 6 years ago

yasindn commented 6 years ago

Hi I have problem with smartreader in my project. I test it in .net core and it's fine but when create project in .net framework it's not work? can you help me?

gabriele-tomassetti commented 6 years ago

It is a .NET Standard 1.3 library so it should work on .NET Framework 4.6. Can you tell me if it does not work for a particular url or for every url you have tried?

yasindn commented 6 years ago

it's not work for any URL when call ParseArticle, app wait on this line and no error and no progress

gabriele-tomassetti commented 6 years ago

Strange, since it does work on my tests. I will do more testing and get back to you.

yasindn commented 6 years ago

Tanks lot, I test it on consoleapp .net framework and it does work fine. but still problem in webapp .net framework. can you send me your webapp test?

yasindn commented 6 years ago

I found problem in code by trace it. the problem is

private async Task<Stream> GetStreamAsync(Uri resource) { using (HttpClient hc = new HttpClient()) { var response = await hc.GetAsync(resource); GetAsync is deadlock!

here is description to solve it. I applied 1st practice and it's solve problem. but 2nd practice is better http://blog.stephencleary.com/2012/07/dont-block-on-async-code.html

gabriele-tomassetti commented 6 years ago

Thanks for your help. I will fix it in the next release and change the API to offer a completely asynchronous option.