HtmlParser. Failed to load file or assembly
See original GitHub issueBug Report
ystem.TypeInitializationException HResult = 0x80131534 Message = Initializer type “AngleSharp.Configuration” threw an exception. Source = AngleSharp Stack trace: in AngleSharp.Configuration.get_Default () in AngleSharp.BrowsingContext.NewFrom [TService] (TService instance) in AngleSharp.Html.Parser.HtmlParser…ctor () in rsh.Parser_test…ctor () in Z: \ vs \ csharp \ prb \ rsh \ rsh \ Parser_test.cs: line 19 in rsh.Form1…ctor () in Z: \ vs \ csharp \ prb \ rsh \ rsh \ Form1.cs: line 18 in rsh.Program.Main () in Z: \ vs \ csharp \ prb \ rsh \ rsh \ Program.cs: line 19
Internal exception 1: FileNotFoundException: Failed to load file or assembly “System.Text.Encoding.CodePages, Version = 4.0.2.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a” or one of their dependencies. Cannot find the specified file.
Prerequisites
no or don’t know
-
Can you reproduce the problem in a MWE? no
-
Are you running the latest version of AngleSharp? Version - 0.10.1
-
Did you check the FAQs to see if that helps you? used google search. did not help
-
Are you reporting to the correct repository? (there are multiple AngleSharp libraries, e.g.,
AngleSharp.Css
for CSS support) see screen -
Did you perform a search in the issues? Searched for phrase: “Failed to load file or assembly”
For more information, see the CONTRIBUTING
guide.
Description
I get the error “Failed to load file or assembly” during application launch
Steps to Reproduce
Error occurs when starting the application
Expected behavior: [What you expected to happen]
Actual behavior: [What actually happened]
Environment details: [OS, .NET Runtime, …] Win 7x64. VS - 2017 .NET Framework 4.6.1
Possible Solution
[Optionally, share your idea to fix the issue]
Code
using AngleSharp.Html.Parser;
namespace rsh
{
class Parser_test
{
HtmlParser domParser;
public Parser_test()
{
domParser = new HtmlParser();
}
}
}
Installation
- I installed AngleSharp on the following principle
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
You need to install the peer dependency
System.Text.Encoding.CodePages
(as the error suggested, potentially it is a language barrier; sorry for that).HTH = Hope that helps
I don’t see any “swearing” but I have a feeling there is a language barrier at work here.
As stated AngleSharp 0.10.1 has a peer dependency (like 0.10.x) to the given package. So I wonder why you think this is a valid question or why you think any behavior of 0.9.x should be relevant to 0.10.x? Its a new major release and it is breaking (please read the migration guide). Thanks and sorry for the inconvenience!