C# On The Client Side With Blazor

Clayton Terry .NET, CSS & HTML, Technology Snapshot Leave a Comment

With the introduction of .Net Core 3.0, Microsoft has built its own web UI framework.

Introducing Blazor: Microsoft’s fully C# client-side framework. With the help of its Razor platform, Microsoft is attempting to put its hat in the ring with the likes of Angular, React, and Vue.

Blazor allows developers to fully design and execute web pages purely with C# — it is meant to eliminate the need for JavaScript. The goal is also to hopefully limit the number of vulnerabilities found in front-end UI work.

In this post, we give an introduction to Blazor and a quick tutorial for getting started.

.NET Memory Management with dotMemory

Jason Schmidtlein .NET, .NET Core, Problem Solving, Technology Snapshot Leave a Comment

Given the maturity of the .NET Framework and the automated nature of its memory management, many developers are guilty of glossing over (or even outright ignoring) whether their code is optimal in terms of CPU and memory usage. Personally, I have caught myself making sure my code is maintainable, testable, and extendable while forgetting to consider memory management in terms of nonfunctional aspects.

While the .NET runtime does a great job and memory corruption is extremely rare, we should still be concerned with memory management, particularly in large-scale .NET base applications.

This concern isn’t limited to on-premise applications. It’s easy to forget about memory usage with cloud computing. Azure Functions and AWS Lambda have billing structures based upon the average memory size per second of function execution. The direct correlation between memory usage and cost couldn’t be more transparent.

Fortunately, there are many great tools to help profile and analyze your memory footprint. JetBrains has a fantastic tool called dotMemory which makes it easy to profile processes, auto detect issues, perform deep analysis, and determine traffic. dotMemory can be installed as either a stand-alone tool or as a part of the ReSharper package integrated into Visual Studio.

In this post, we’ll show how to use dotMemory to generate a memory profile and analyze a memory leak in a .NET Core application.

Create your own web bots in .NET with CEFSharp!

Matt Cunningham .NET, JavaScript, Programming, Tutorial Leave a Comment

Have you ever wanted to create an automated way to load, manipulate, and then act upon a web page?

Using CEFSharp (and some strategic JavaScript), you can create headless (no GUI) interfaces of Chrome’s parent browser, Chromium, and then instruct them to do pretty much anything a web browser can do.

This is a tutorial about using CEFSharp to accomplish some basic web functions with simple examples. We’ll create three automated bots that can simulate user web interaction and programmatically react to browser events using CEF and the CEFSharp library. You can follow along by copying the code provided or by downloading…

Using Dapper Flexibly

Jason Schmidtlein .NET, Problem Solving, Technology Snapshot 1 Comment

Dapper is a micro ORM (Object Relational Mapper) for .NET that is nearly as fast as using a raw ADO.NET data reader. It is a great alternative to Entity Framework, especially when performance is a top priority and you don’t need all the features of a “heavy” ORM.

In this post, I will provide an example of creating a generic CRUD repository that leverages the performance of Dapper while providing flexibility for a multitude of scenarios..

Into the Core

James Bradley .NET, .NET Core, ASP.NET, Technology Snapshot, Tutorial Leave a Comment

The client I’m currently assisting has begun to move applications from more monolithic architecture into a more modern, cloud-based architecture. The organization is a bit of a .NET anomaly in that it is a company that’s primarily Java, yet has some .NET.

So even though Microsoft has a list of framework tools (such as Azure Service Fabric and Azure App Service), it’s fair to say that asking a primarily Java-focused company to use those tools could be an uphill battle. This is where .NET Standard and .NET Core have come to the rescue.

I work with a ton of smart people and I’m pretty amazed at how fast they can pick up on things from reading. I, however, cannot really understand it fully until I touch it. So let’s build a quick RESTful Web API step by step to see how challenging it is. We’ll be using .NET Standard, .NET Core, and ASP.NET Core.