Dumping any requests in ASP.NET Core 2.0

Once, I was needed to have a simple endpoint in which I can send any request for test purposes. Just a simple web service that eats a request, no matter what HTTP method and route are used.

Fortunately, Microsoft did a great job making ASP.NET Core as flexible as possible, so the solution turned up quite short and simple.

Assembly location in ASP.NET

An interesting note that I've found while updating the ConfigEx library: the assembly DLL file in the ASP.NET application might be located in a place different from what we expect. During runtime, it is actually not in the place where the application is hosted.

Polymorphic serialization using Json.NET in HttpContent

Imagine a quite common client-server application where the server exposes REST methods and the client communicates using HTTP requests. Requests and responses are serialized in JSON format. There might be a problem if you try to send and receive a DTO that contains a collection of interfaces or abstract classes. I will talk about the usage of Web API and Newtonsoft Json.NET as its underlying serialization library.