Strip HTML using HtmlAgilityPack
public static string StripHtml(this string value)
HtmlDocument htmlDoc = new HtmlDocument();
if (htmlDoc == null)
Source: Strip HTML using HtmlAgilityPack
After adding a new 3rd party reference to a project and then building for Release configuration I got this error (not present when in debug build):
Error Could not load file or assembly ‘x’ or one of its dependencies. The system cannot find the file specified. SGEN
Here is a solution that worked for me:
If you are having this problem while building your VS.NET project in Release mode here is the solution: Go to the project properties and click on the Build tab and set the value of the “Generate Serialization Assembly” dropdown to “Off”. Sgen.exe is “The XML Serializer Generator creates an XML serialization assembly for types in a specified assembly in order to improve the startup performance of a XmlSerializer when it serializes or deserializes objects of the specified types.” (MSDN)
Source: c# – sgen.exe fails during build – Stack Overflow
Measure which methods takes longest time (cpu analysis) or how the memory is used in a .NET application with the built-in Performance Profiler in Visual Studio 2017
Logging information in .NET, or really in any production application, is invaluable. In many cases, developers don’t have direct access to the production environment to debug issues. Good quality logs are the difference between solving problems like Sherlock Holmes and stumbling upon solutions like Inspector Jacques Clouseau. As you can imagine, we’re pretty big on logging here at Stackify, and we’ve written quite a few other blog posts on .NET logging frameworks. I’d encourage you to try out the search and read a few of our previous articles.
Source: NLog vs log4net vs Serilog: Compare .NET Logging Frameworks
Log4View is a powerful and comfortable viewer for log4net, NLog, log4j and log4xx
Log4View Community Edition is free to use.
Log4View comes in three different editions:
- Log4View Professional Edition is the most complete edition of Log4View. It can handle up to 255 different log sources simultaneously, can read input from databases and visualizes log messages as text and chart.
- Log4View Trial Edition has the same features as Log4View Proferssional Edition but expires 30 days after installation. After expiration, the Trial Edition continues working as Community Edition.
- Log4View Community Edition is limited to one log source, has no access to databases and can’t visualize log messages as chart. Log4View Community Edition is free for personal, non commercial use.
Download: Log4View – LOG4VIEW – created by PROSA
Guard is a fluent argument validation library that is intuitive, fast and extensible.
Source: GitHub – safakgur/guard: A high-performance, extensible argument validation library.
when I change the targetting from .net 4.6.1 to .net 4.7 . I get this error when build , but there is no project .json , how can I pass this? project cannot compile now. Severity Code Description Project File Line Suppression State Error ` Your project is not referencing the “.NETFramework,Version=v4.7” framework. Add a reference to “.NETFramework,Version=v4.7” in the “frameworks” section of your project.json, and then re-run NuGet restore.
/obj and rebuild your solution.
Source: change a .net 4.6.1 project to .net 4.7 failed – Stack Overflow
If you’re a .NET developer, we’re excited to introduce a new resource that can help you learn about Azure: The Azure Quick Start Guide for .NET Developers!
Source: Get the Azure Quick Start Guide for .NET Developers
I’m getting, “Could not load file or assembly ‘Bla’ or one of its dependencies. An attempt was made to load a program with an incorrect format.”
Source: registry – How can I enable Assembly binding logging? – Stack Overflow