A fairy tale about async voids, events and error handling

Let me tell you a story about async voids, SynchronizationContext, and async programming. A few days ago we got an issue on Puppeteer-Sharp describing two problems: Puppeteer-Sharp crashes with exceptions which cannot be caught. KeyNotFoundException trying to get a Frame The code was pretty simple: var launchOptions = new LaunchOptions()... [Read More]

Happy Birthday Puppeteer Sharp!

One year ago today I pushed my first commit to the Puppeteer-Sharp repo. As most “first commits” it was a small commit, adding the readme and the gitignore, but that commit marked the beginning of a year full of learned lessons. What did we accomplish so far? 18 releases 237... [Read More]

How do you spell 👹 in C#?

A few days ago, I had to implement a new feature on Puppeteer-Sharp. The library needed to be able to send emojis through its typing simulation. Trying to send and read an 👹 from a WebSocket might be quite confusing. You could get an □ on the other side or... [Read More]
Tags: csharp

C# wishlist - Internal interfaces

I know that changing how internfaces work in C# would be something hard to accomplish, and its implementation is quite “by the book”. But let me dream for a while and share this idea. When you create an internal interface, what you are saying is that any class implementing that... [Read More]
Tags: csharp dotnet

C# wishlist - Extension methods for events

Node.js has a pretty cool useful feature which is the ability to listen to an event only once. Using the eventEmitter.once() method, it is possible to register a listener that is called at most once for a particular event. Once the event is emitted, the listener is unregistered and then... [Read More]
Tags: csharp dotnet

Puppeteer Sharp Monthly Report - July 2018

The World Cup is here, but it didn’t stop is from releasing v1.1 in June! v1.1 is the first version created from a diff between two puppeteer versions: v1.0 and v1.1. This brought about some challenges, but let’s talk about features first. New Features The Downloader class has been improved... [Read More]

Puppeteer Sharp v0.7 Released!

We are shipping Puppeteer Sharp v0.7 with many cool new features: Element selectors and evaluation over elements. But our big challenge on v0.7 was one of the hard things in computer science: Naming Things. Puppeteer has these 5 cool functions: $(selector): It calls document.querySelector and returns an ElementHandle. $$(selector): It... [Read More]

Puppeteer Sharp Monthly Report - May 2018

April was a great month for Puppeteer Sharp. We launched v0.4, which is huge! But not only that, we’ve got two more contributors. That means that I had to spend more time getting the issues and milestones ready for them as well as doing more code review. I wouldn’t have... [Read More]

Puppeteer Sharp v0.4 is here and it's huge!

I’m so excited to announce that Puppetter Sharp v0.4 is ready to download from Nuget. It includes more than 25 Page APIs such as: Full Page.GoToAsync/ReloadAsync support Emulate/EmulateMedia/SetViewport/SetUserAgent Get and Set cookies SetContent Evaluate javascript functions and expressions WaitFor expressions await page.GoToAsync("http://www.mysite.com"); //Do you need to wait for your javascript... [Read More]

Puppeteer Sharp Monthly Report - April 2018

March was an exciting Month for Puppeteer Sharp. CI Server is up an running. Version 0.3 was released, implementing IDisposable, many Puppeteer features (such as User dat dir support) and also fixing many process leaks. We also released v.0.3.1, adding .NET Framework support. We are now working on v0.4, which... [Read More]

Killing boilerplates in ASP.NET - Volume 1

We all hate boilerplates, right? That bunch of code that you copy over and over again. Boilerplates are not a complex piece of code but code so simple that we don’t take time to think about it. In this post, I will cover how to reduce some boilerplates we use... [Read More]
Tags: csharp aspnet

Implementing PageSession in ASP.NET Webforms

Maintaining the state of a large page can be quite a challenge. Let’s say you were asked to implement a page with four tabs, each with two GridViews. Each Gridview would be editable and you would have one save button which would execute all database actions. The most common solutions... [Read More]
Tags: csharp aspnet

Puppeteer Sharp Monthly Report - March 2018

Puppeteer Sharp v0.1 released! I’m super excited to announce that the first usable version of Puppeteer Sharp is ready to download from Nuget. The first milestone on the roadmap is completed. What can you do so far? PDF support You can export any page to PDF file. var browser =... [Read More]

Implementing a BasePage in your ASP.NET Webforms Project

I started to prepare two posts, one about Page Sessions and the other one about reducing QueryString, ViewState and Session boilerplate. But I realized that both solutions were implemented on a BasePage. So I felt that I first needed to write about the importance of implementing a BasePage in a... [Read More]
Tags: csharp aspnet