Less code is often better
Nate McMaster
by Nate
10M ago
Early in my software engineering career, a senior engineer at Microsoft told me “the best solution is one that requires no new code.” At the time, I thought this was nonsense. Is not my role as a software engineer to write code? Why would writing less or no code be better? More code means more bug fixes, more features, more services, and more tools. So why is more not always better? Fast forward to 2023 – now I am the most senior engineer on a team, and I give the same guidance. Prefer solutions that require less or no code. What led to this shift in perspective? It boils down to this: writing ..read more
Visit website
Deep-dive into .NET Core primitives, part 3: runtimeconfig.json in depth
Nate McMaster
by Nate
3y ago
NET Core applications contain a file named <something>.runtimeconfig.json. This file can be used to control a variety of options. Most developers need not be concerned with it because the SDK generates the file, but I think it’s worth understanding. The file can be used to control settings which are not surfaced in Visual Studio, such as automatically running your app on higher .NET Core versions, tuning thread pools and garbage collection, and more. This post is part of a series: Part 1 - .deps.json, runtimeconfig.json, and dll’s Part 2 - the shared framework Part 3 - runtimeconfig.js ..read more
Visit website
Deep-dive into .NET Core primitives, part 2: the shared framework
Nate McMaster
by Nate
3y ago
Shared frameworks have been an essential part of .NET Core since 1.0. ASP.NET Core shipped as a shared framework for the first time in 2.1. You may not have noticed if things are working smoothly, but there have been some bumps and ongoing discussion about its design. In this post, I will dive deep into the shared frameworks and talk about some common developer pitfalls. This post is part of a series: Part 1 - .deps.json, runtimeconfig.json, and dll’s Part 2 - the shared framework Part 3 - runtimeconfig.json in depth The Basics .NET Core apps run in one of two modes: framework-dependent or s ..read more
Visit website
.NET Core Plugins
Nate McMaster
by Nate
3y ago
I recently published a new package for .NET Core developers that want to implement a plugin system. Dynamic assembly loading in .NET Core is difficult to get right. The API in this package wrangles the complexity through a feature called ‘load contexts’. In this post, I’ll walk through problems that motivated the creation of this project, and explain what the API can do. My hope is that this plugin API will let you focus more on writing your app, and put an end to the inevitable mess of creating your own assembly loading code. TL;DR? the the project source is visible on GitHub the package is ..read more
Visit website
Configuring ASP.NET Core, webpack, and hot module replacement (hmr) for fast TypeScript development
Nate McMaster
by Nate
3y ago
Recently, I spent a weekend banging my head against the wall as I tried to figure out how to upgrade a personal project to webpack 4, TypeScript 2.9, and React (used to be AngularJS 1.6). I finally got it all working together – and even got hot module replacement (hmr) working. TL;DR? Checkout the code here: https://github.com/natemcmaster/aspnetcore-webpack-hmr-demo The important bits: Use the WebpackDevMiddleware This middleware in ASP.NET Core is built-in to ASP.NET Core 2.1, but you have to specifically add an option to configure HMR. Add this to your Startup.cs file. app.UseWebpackDevMi ..read more
Visit website
Enabling code signing with NuGet, Azure Key Vault, and AppVeyor
Nate McMaster
by {"twitter"=>"natemcmaster"}
3y ago
About 4 weeks ago, I decided to code sign the NuGet packages from my personal open-source projects. I finally succeeded this weekend. When I started, I figured it couldn’t be that hard. In the end, it really isn’t, but it took hours of research to figure out how to tie it all together. In this post, I’ll share the technical details of what it took to enable code signing using Azure Key Vault, AppVeyor, and NuGet for one of my .NET Core projects. Background If you find this subject daunting, even with instructions, you are not alone. Years ago in school, Kent Seamons showed my class usability s ..read more
Visit website
Dotnet watch 2.1
Nate McMaster
by {"twitter"=>"natemcmaster"}
3y ago
NET Core 2.1 RC1 was released this week. This is the first supported version of the .NET Core CLI which ships dotnet watch as a built-in command. In addition to changing how this tool ships, dotnet-watch 2.1 has a few improvements that make it the best version yet. Download the .NET Core CLI 2.1 here. dotnet watch from anywhere In earlier versions of .NET Core, you had to add a <DotNetCliToolReference> into each .csproj file in order to use dotnet watch. And you could only invoke it from the project directory. No more! You can remove your DotNetCliToolReference’s to Microsoft.DotNet.Wat ..read more
Visit website
.NET Core 2.1 Global Tools
Nate McMaster
by {"twitter"=>"natemcmaster"}
3y ago
NET Core 2.1 RC1 was released this week. This is the first supported version of the .NET Core CLI which includes a feature called “.NET Core Global Tools”. This feature provides a simple way to create and share cross-platform console tools. In this post, I’ll go over some of the basics, and then walk though what is going on under the hood. You will need to download .NET Core 2.1 to use this to try this on your own. Tip: For a real-world example of a global tool, see https://github.com/natemcmaster/dotnet-serve/. Basic design A .NET Core global tool is a special NuGet package that contains a c ..read more
Visit website
.NET Core Global Tools and Gotchas
Nate McMaster
by {"twitter"=>"natemcmaster"}
3y ago
As announced recently in the .NET Core 2.1 Roadmap, the .NET Core 2.1.300 SDK will add a feature called “.NET Core Global Tools”. This announcement contains a brief snippet of how the tools will work. As this feature is new, there are some rough edges. In this post, I’ll go over the basic design of how global CLI tool should work, some of the gotchas, and how to make it all work. :warning: (Update May 12, 2018) This post was written for 2.1 Preview 1 and is now obsolete. See this post for an updated version For those who want to get started on code right away, checkout the project templates ..read more
Visit website
Deep-dive into .NET Core primitives: deps.json, runtimeconfig.json, and dll’s
Nate McMaster
by Nate
3y ago
I learned to program with gcc, C++, and vim. When I started working with C# and .NET, clicking the “Start” button in Visual Studio was magical, but also dissatisfying. Dissatisfying – not because I want to write a Makefile – but because I didn’t know what “Start” did. So, I started to dig. In this post, I’ll show the most primitive tools used in .NET Core, and manually create a .NET Core app without the help of Visual Studio. If you’re new to .NET Core and want to peek under the hood, this is a good post for you. If you’re already a .NET Core developer and wonder what *.deps.json or *.runtimec ..read more
Visit website

Follow Nate McMaster on FeedSpot

Continue with Google
Continue with Apple
OR