Updating to .NET 8, updating to IHostBuilder, and running Playwright Tests within NUnit headless or headed on any OS
Scott Hanselman's Blog
by Scott Hanselman
3w ago
I've been doing not just Unit Testing for my sites but full on Integration Testing and Browser Automation Testing as early as 2007 with Selenium. Lately, however, I've been using the faster and generally more compatible Playwright. It has one API and can test on Windows, Linux, Mac, locally, in a container (headless), in my CI/CD pipeline, on Azure DevOps, or in GitHub Actions. For me, it's that last moment of truth to make sure that the site runs completely from end to end. I can write those Playwright tests in something like TypeScript, and I could launch them with node, but I like running ..read more
Visit website
Using WSL and Let's Encrypt to create Azure App Service SSL Wildcard Certificates
Scott Hanselman's Blog
by Scott Hanselman
9M ago
There are many let's encrypt automatic tools for azure but I also wanted to see if I could use certbot in wsl to generate a wildcard certificate for the azure Friday website and then upload the resulting certificates to azure app service. Azure app service ultimately needs a specific format called dot PFX that includes the full certificate path and all intermediates. Per the docs, App Service private certificates must meet the following requirements: Exported as a password-protected PFX file, encrypted using triple DES. Contains private key at least 2048 bits long Contains all intermediate c ..read more
Visit website
GitHub Copilot for CLI for PowerShell
Scott Hanselman's Blog
by Scott Hanselman
1y ago
GitHub Next has this cool project that is basically Copilot for the CLI (command line interface). You can sign up for their waitlist at the Copilot for CLI site. Copilot for CLI provides three shell commands: ??, git? and gh? This is cool and all, but I use PowerShell. Turns out these ?? commands are just router commands to a larger EXE called github-copilot-cli. So if you go "?? something" you're really going "github-copilot-cli what-the-shell something." So this means I should be able to to do the same/similar aliases for my PowerShell prompt AND change the injected prompt (look at me I'm ..read more
Visit website
Use your own user @ domain for Mastodon discoverability with the WebFinger Protocol without hosting a server
Scott Hanselman's Blog
by Scott Hanselman
1y ago
Mastodon is a free, open-source social networking service that is decentralized and distributed. It was created in 2016 as an alternative to centralized social media platforms such as Twitter and Facebook. One of the key features of Mastodon is the use of the WebFinger protocol, which allows users to discover and access information about other users on the Mastodon network. WebFinger is a simple HTTP-based protocol that enables a user to discover information about other users or resources on the internet by using their email address or other identifying information. The WebFinger protocol is ..read more
Visit website
I got tired
Scott Hanselman's Blog
by Scott Hanselman
1y ago
I have been blogging here for the last 20 years. Every Tuesday and Thursday, quite consistently, for two decades. But last year, without planning it, I got tired and stopped. Not sure why. It didn't correspond with any life events. Nothing interesting or notable happened. I just stopped. I did find joy on TikTok and amassed a small group of like-minded followers there. I enjoy my YouTube as well, and my weekly podcast is going strong with nearly 900 (!) episodes of interviews with cool people. I've also recently started posting on Mastodon (a fediverse (federated universe)) Twitter alternativ ..read more
Visit website
Using Home Assistant to integrate a Unifi Protect G4 Doorbell and Amazon Alexa to announce visitors
Scott Hanselman's Blog
by Scott Hanselman
2y ago
I am not a Home Assistant expert, but it's clearly a massive and powerful ecosystem. I've interviewed the creator of Home Assistant on my podcast and I encourage you to check out that chat. Home Assistant can quickly become a hobby that overwhelms you. Every object (entity) in your house that is even remotely connected can become programmable. Everything. Even people! You can declare that any name:value pair that (for example) your phone can expose can be consumable by Home Assistant. Questions like "is Scott home" or "what's Scott's phone battery" can be associated with Scott the Entity in t ..read more
Visit website
JavaScript and TypeScript Projects with React, Angular, or Vue in Visual Studio 2022 with or without .NET
Scott Hanselman's Blog
by Scott Hanselman
2y ago
I was reading Gabby's blog post about the new TypeScript/JavaScript project experience in Visual Studio 2022. You should read the docs on JavaScript and TypeScript in Visual Studio 2022. If you're used to ASP.NET apps when you think about apps that are JavaScript heavy, "front end apps" or TypeScript focused, it can be confusing as to "where does .NET fit in?" You need to consider the responsibilities of your various projects or subsystems and the multiple totally valid ways you can build a web site or web app. Let's consider just a few: An ASP.NET Web app that renders HTML on the server but ..read more
Visit website
A Nightscout Segment for OhMyPosh shows my realtime Blood Sugar readings in my Git Prompt
Scott Hanselman's Blog
by Scott Hanselman
2y ago
I've talked about how I love a nice pretty prompt in my Windows Terminal and made videos showing in detail how to do it. I've also worked with my buddy TooTallNate to put my real-time blood sugar into a bash or PowerShell prompt, but this was back in 2017. Now that I'm "Team OhMyPosh" I have been meaning to write a Nightscout "segment" for my prompt. Nightscout is an open source self-hosted (there are commercial hosts also like T1Pal) website and API for remote display of real-time and near-real-time glucose readings for Diabetics like myself. Since my body has an active REST API where I can ..read more
Visit website
Upgrading a 20 year old University Project to .NET 6 with dotnet-upgrade-assistant
Scott Hanselman's Blog
by Scott Hanselman
2y ago
I wrote a Tiny Virtual Operating System for a 300-level OS class in C# for college back in 2001 (?) and later moved it to VB.NET in 2002. This is all pre-.NET Core, and on early .NET 1.1 or 2.0 on Windows. I moved it to GitHub 5 years ago and ported it to .NET Core 2.0 at the time. At this point it was 15 years old, so it was cool to see this project running on Windows, Linux, in Docker, and on a Raspberry Pi...a machine that didn't exist when the project was originally written. NOTE: If the timeline is confusing, I had already been working in industry for years at this point but was still p ..read more
Visit website
.NET 6 Hot Reload and "Refused to connect to ws: because it violates the Content Security Policy directive" because Web Sockets
Scott Hanselman's Blog
by Scott Hanselman
2y ago
If you're excited about Hot Reload like me AND you also want an "A" grade from SecurityHeaders.com (really, go try this now) then you will learn very quickly about Content-Security-Policy headers. You need to spend some time reading and you may end up with a somewhat sophisticated list of allowed things, scripts, stylesheets, etc. In DasBlog Core (the cross platform blog engine that runs this blog) Mark Downie makes these configurable and uses the NWebSpec ASP.NET Middleware library to add the needed headers. if (SecurityStyleSources != null && SecurityScriptSources != null && ..read more
Visit website

Follow Scott Hanselman's Blog on FeedSpot

Continue with Google
Continue with Apple
OR