General learning stuff

First, a little follow-up from my last post: The Credly thing was a little weird. There’s a working LinkedIn integration that will add the credential to your profile and let you post about it. So that’s good. There are options to share to Twitter and Facebook too, but neither worked. I manually posted the credential link to Facebook, Twitter, and Mastodon, just for yuks. So maybe I’ll get some “likes” out of that. Not that it matters, but I crave attention and validation, like most 21st-century humans.

On the broader topic of education: I’ve been working on figuring out some of the newer .NET Web API stuff lately. My existing .NET Web APIs are all .NET 4.x. Until recently, I hadn’t tried to create one under ASP.NET Core. I’ve been working my way through this course on Pluralsight.

I still get access to Pluralsight through work, which is great. My company recently discontinued access to Percipio though. I wasn’t really using Percipio that much, and I still have access to it through ACM, so it’s no big deal that work has stopped paying for it. That got me thinking about O’Reilly Learning again. When I got the email telling me that we were dropping Percipio, I responded with a suggestion that they look into O’Reilly. I don’t have much hope that our L&D folks will want to spend the money on O’Reilly, but I thought I’d suggest it. You never know.

Our L&D folks (and I guess someone influential in management) have been pushing a lot of leadership stuff lately in a couple of areas that I wasn’t previously familiar with. First is John C. Maxwell’s 5 levels of leadership. I guess that Maxwell is actually a pretty big name in the “leadership” area, though I’d never heard of him. He’s written a bunch of books. I’m considering picking up the 5 Levels of Leadership book, either in Kindle or Audible format. I’ve got mixed feelings though. On the one hand, I want to learn stuff that might be important and help make me a better manager. On the other hand, I’m about halfway through the third Wheel of Time book, and I don’t want to get off track on that.

The other big thing they’re starting to push at work is something called Emergenetics, which sounds pretty fishy to me, but is apparently not a weird pseudo-religion or anything like that. I don’t have much to say about it, since i haven’t really started looking into it yet.

I’m not really sure where these two initiatives came from. It might be somebody in L&D, or somebody in management. We do have a bunch of new high-level managers that have been hired from outside recently. We used to get most of our high-level managers from internal promotions, but I guess our president wanted to bring in some fresh blood. Overall, there’s a good bit of uncertainty in the company, due to all of the new managers coming in, and various changes going on. I’m trying to take a “wait and see” attitude, and keep an open mind.

I do have three direct reports now, so I should probably try to keep up on the management philosophy stuff. I haven’t really been an active manager in a long time. And, since they made me a manager about six months ago, I’ve actually done very little management. I’m mostly just letting my direct reports do their work, and leaving them alone. But I should probably try to more actively engage with them. At some point, I’ll probably have to do performance reviews, so I guess I should at least engage enough to be able to do that properly.

It’s hard to juggle all of this. I want to keep up on all the technical stuff, like ASP.NET and Power Platform, and so on, but I also need to work on the “soft skills” stuff.

finally Microsoft certified, again

Well, it’s just about three months since I committed to taking the exam for Microsoft’s PL-900 certification. Per this post, I got an exam voucher from my company, back in March. At that time, I set a “next week” reminder flag on that email in Outlook, and I’ve just been kicking the reminder to “next week” again every Friday. So finally I decided to just stop putting it off and take the test today. (It helps that it was a quiet day, with nothing else on my calendar.)

I have a few observations about the exam-taking process that I thought I’d share, since I wasn’t at all sure how it was going to work, so maybe this will help someone else who is planning on taking a Microsoft exam.

First, I wasn’t sure if I should go for the at-home option or go to a testing center. I checked Pearson’s site for local testing centers, and there’s one that’s about 10 miles away from here. So not too far, but far enough that I thought I’d try the at-home option instead.

At-home, of course, was not an option the last time I took an exam, back in 2010. I’d heard some worrying things about the requirements for at-home tests, which I wasn’t sure I’d be able to fulfill. They want to minimize cheating, of course, so you have to take photos of your work environment, to show that you don’t have any reference material at hand. My apartment is so cluttered that I wasn’t sure I’d be able to do that. But I managed to clear everything off my kitchen table, and I guess the photos I took were good enough for them.

But to back up a bit, first I had to schedule the exam. I know that there’s supposed to be some human review/monitoring of the exam, so I wasn’t sure if it would be easy to get a spot, but it turned out to be quite easy to schedule the exam for today. If I’d wanted, I could have taken the exam right away. I didn’t want that though, so I scheduled it for 1:45 PM. You need to check in for the exam prior to the start time, and you can do that 30 minutes prior.

After registration, I went through the “pre-flight check” that involved downloading a small program to my computer and verifying that my webcam and microphone worked, and that my internet connectivity was good enough. That was no problem.

After that, I spent some time taking (and failing) the MeasureUp practice exam again. Given that I’ve never successfully passed the practice exam, I really wasn’t sure I’d be able to pass the real one.

So at 1:15 PM, I went ahead and checked in for the exam. That process takes a while, and requires you to go through the webcam and microphone check again. Then it requires you to take some photos on your phone. They need a photo of your face, your ID (front and back), and four photos of your workspace. That all went smoothly enough. There’s no phone app for this; it’s all done through a website, which you can get to through a QR code or a text message link.

Once you’ve done all that, you have to put your phone away, so it’s out of reach, then you get put into a queue to start the test. I’m guessing that a human needs to manually review your photos and OK them. Or maybe it’s all fed into an AI thing, and only manually reviewed if the AI fails. I don’t know. It took a while for me to get out of the queue, and there were a couple of notices about connection issues that worried me a bit. But eventually I got through and the test started.

I kind of thought that there might be some required human interaction before the test, either in chat or onscreen via webcam/mic, but there was none. I just got transferred into the test.

There weren’t any unexpected surprises in the test itself. The questions were all pretty similar to what I’d seen in the practice exams. It took me about 30 minutes out of the 45 allowed to finish. And I got my results onscreen right after the exam.

I passed by a pretty reasonable margin, I think. I guess that result is a combination of (1) taking the real test more seriously than the practice tests, (2) having learned something from my repeated practice test failures, and (3) the practice tests being purposely harder than the real test.

So, post-exam, I went to the MS Learn site and downloaded a little PDF certificate, showing that I passed. I couldn’t initially find a detailed report on my score, but I just went back and checked again, and it’s there, on Pearson’s site. So my actual score was 822, where 700 was passing. Info on the scoring and the reports can be found here. I guess that’s 822 out of 1000, so… good enough.

I guess the next step here is to boast about passing the exam on social media. I think there was something on LinkedIn at one point where you could link your MCP profile to LinkedIn and then post a verified link to show that you’ve actually passed. I’m not sure if that’s still there, or if I’m even remembering that correctly. So I’ll want to look at that. And I kind of remember at one point that if you tagged MS Learning in a tweet about passing an exam, they’d retweet it and congratulate you. So I should see if I can do that. (Though I’m mostly staying off Twitter these days, for obvious reasons…)

I’ve already sent the scoring report to the person at my company that sent me the exam voucher. I guess that having a certain number of certified professionals on staff does something to help us maintain our partner status, or something like that. I know that we keep track of it.

I don’t really get much, personally, out of passing this exam. I’m not looking for a new job, and if I was, it wouldn’t be as a Power Platform guy anyway. And I don’t get a raise or bonus for doing it. But it was kind of fun and interesting to do. It’s been so long since I’ve had to take a test that it felt kind of weird to do it.

On the broader topic of continuing education, I’ve got a lot of stuff going on. This post is getting pretty long, so I’m not going to get into any of that here. Maybe I’ll write up another post over the weekend.

(UPDATE: Since I first published this, I’ve figured out that I can share a certified link to the certification through a site called Credly. So here’s the official link. So now you know I’m not lying about all this.)

getting authentication tokens from MSAL via PowerShell

I have a little PowerShell script that I can use to get tokens from MSAL, for an API project I maintain, and I could have sworn that I’d blogged about it at some point. But I can’t find a post mentioning it. So I guess it’s one of those things I meant to blog about, but never got around to it.

I just rewrote it for a new API project, so I thought I’d blog about that. And since I never actually blogged about the first version, I might as well include that too.

So the first API is an older .NET Framework project. In the Visual Studio solution, I have both the API and a console program that can be used to run some simple tests against it. The console program, of course, uses MSAL.NET to authenticate. (I blogged about that in 2021.) I also like to do little ad-hoc tests of the API with Fiddler, using the Composer tab. But I need to get a bearer token to do that. There are a bunch of ways to do that, but I wanted a simple PowerShell script that I could run at the command line and that would automatically save the token to the clipboard, so I could paste it into Fiddler. I also wanted the PowerShell script to read the client ID and secret (and other parameters) from the same config file that was used for the console program. The script shown below does that, reading parameters from the console program’s app.config file, and pulling the actual client ID and secret from environment variables. (All of this is, of course, to avoid storing secrets in any text files that might get accidentally checked in to source control…)

# get-auth-hdr-0.ps1
# https://gist.github.com/andyhuey/68bade6eceaff64454eaeabae2351552
# Get the auth hdr and send it to the clipboard.
# ajh 2022-08-29: rewrite to use MSAL.PS.
# ajh 2022-11-23: read secret from env vars.

#Requires -Version 5.1
#Requires -Modules @{ ModuleName="MSAL.PS"; ModuleVersion="4.0" }

# force TLS 1.2
$TLS12Protocol = [System.Net.SecurityProtocolType] 'Tls12'
[System.Net.ServicePointManager]::SecurityProtocol = $TLS12Protocol

echo $null | clip	# clear the clipboard.

# read the settings file.
$configFilePath = ".\App.config"
$configXML = Get-Content $configFilePath
$configXML.configuration.appSettings.add | foreach {
	$add = $_
	switch($add.key) {
		"ida:Authority" 		{$authority = $add.value; break}
		"xyz:ServiceResourceId"	{$svcResourceId = $add.value; break}
		"env:ClientId"			{$client_id_var = $add.value; break}
		"env:ClientSecret" 		{$client_secret_var = $add.value; break}
	}
}
if (!$client_id_var -or !$client_secret_var -or !$authority -or !$svcResourceId) {
	Write-Error "One or more settings are missing from $configFilePath."
	return
}

# and the env vars.
$client_id = [Environment]::GetEnvironmentVariable($client_id_var, 'Machine')
$client_secret = [Environment]::GetEnvironmentVariable($client_secret_var, 'Machine')
if (!$client_id -or !$client_secret) {
	Write-Error "One or more env vars are missing."
	return
}

$scope = $svcResourceId + "/.default"
$secSecret = ConvertTo-SecureString $client_secret -AsPlainText -Force

$msalToken = Get-MsalToken -ClientId $client_id -ClientSecret $secSecret -Scope $scope -Authority $authority
$authHdr = $msalToken.CreateAuthorizationHeader()
$fullAuthHdr = "Authorization: $($authHdr)"
$fullAuthHdr | clip
"auth header has been copied to the clipboard."

For my new project, I needed to create a new version of this script, since the new project is in .NET Core, using an appsettings.json file rather than the old XML format app.config file. I’m also now using the Secret Manager to store the client ID and secret.

# get-auth-hdr-1.ps1
# https://gist.github.com/andyhuey/de85972ec0f6268034e5ce46b0278a07
# Get the auth hdr and send it to the clipboard.
# ajh 2023-04-06: new. 

#Requires -Version 7
#Requires -Modules @{ ModuleName="MSAL.PS"; ModuleVersion="4.0" }

# force TLS 1.2
$TLS12Protocol = [System.Net.SecurityProtocolType] 'Tls12'
[System.Net.ServicePointManager]::SecurityProtocol = $TLS12Protocol

echo $null | clip	# clear the clipboard.

$secrets = dotnet user-secrets list --json | ConvertFrom-Json
$clientId = $secrets.'AuthConfig:ClientId'
$clientSecret = $secrets.'AuthConfig:ClientSecret'
$secSecret = ConvertTo-SecureString $clientSecret -AsPlainText -Force

$appSettings = Get-Content appsettings.json | ConvertFrom-Json
$scope = $appSettings.AuthConfig.ResourceId
$authority = $appSettings.AuthConfig.Instance -f $appSettings.AuthConfig.TenantId

$msalToken = Get-MsalToken -ClientId $clientId -ClientSecret $secSecret -Scope $scope -Authority $authority
$authHdr = $msalToken.CreateAuthorizationHeader()
$fullAuthHdr = "Authorization: $($authHdr)"
$fullAuthHdr | clip
"auth header has been copied to the clipboard."

So this one is calling “dotnet user-secrets list” to get the secrets. And it’s using “ConvertFrom-Json” for both that and the appsecrets.json file.

Both scripts are using MSAL.PS for the MSAL call.

One thing that might not be obvious in the second script is that the “Instance” value is formatted like this: “”https://login.microsoftonline.com/{0}” so we’re using the “-f” string format function to pop the tenant ID into that {0} placeholder. (I took that functionality from an online sample I found somewhere, but I may change that around, since I think it just confuses things.) Also, in the first example, I added “/.default” to the $scope variable in the script, while the new version already has that in the config file.

I’m not sure if any of this will ever be useful to anyone but me, but it seems like something that might help someone else out there on the internet somewhere, at some point.

more on Microsoft certification

Since this post from earlier this month, I asked my boss about whether or not the company would pay for a cert exam for me, and I got back not just a “yes” but an exam voucher code, and a code for a free MeasureUp practice exam! Which is great, but now I guess I have to take the exam.

I just noticed this post in my “on this day” sidebar, with a nice photo of the three giant books I bought to study for the three cert exams I was going to take for ASP.NET certification, back in 2010. I only ever took the first exam, then I got too busy with work to study for and take the other two.

I feel like I’m in a similar situation now, except that I’m not even going to find time to study for and take the first exam. I used the MeasureUp code, and got access to the practice test for PL-900. It seems to be identical to the MeasureUp test that I previously got for free through ESI. I took it again, and got less than 60% on it, which is definitely not a passing grade. If I want to pass, I think I need to study up on some areas I didn’t do well in, which are basically the areas that I’m not interested in and that aren’t relevant to my job right now. But if I want to pass the test, I guess I need to learn them. Sigh.

Microsoft certification

I’ve been trying to learn a lot of new stuff lately, including Power Platform, which I’ve mentioned a few times recently. And I’ve been thinking about taking the certification exam for that, PL-900. My company has access to something called ESI from Microsoft, which used to allow us to take MS exams for free. Well, I guess I waited too long on the PL-900 exam, since they changed ESI so it now only provides a 50% discount. And the ESI site used to allow us to take MeasureUp practice exams, but now it just shows us simpler Microsoft-provided practice tests. I’ve seen some talk about both of these changes on reddit, here and here.

Well, at 50% off, the test is only $50, which I can, of course, afford. Thirty days of access to the MeasureUp practice exam is $99, though they’ve got a 30% off sale going on right now. That might be worth it, but maybe not. I haven’t tried the new Microsoft practice test yet, though it seems to be less full-featured than the MeasureUp one.

Anyway, my last Microsoft cert exam was in 2010. It’s so hard to keep up with all this stuff. I’ve been busy enough this week that I haven’t gotten back to any of my “spare time” learning work. If I really want to take (and pass) that PL-900 exam, I need to brush up on a few things first.

Shuffling iPads

It’s Thanksgiving here in the USA, and I have nothing to do, so I’m going to spend some time this morning writing a rambling blog post about iPads.

I have a company-owned iPad, that I got back in 2016. It was originally supposed to be for testing a project that we thought would be accessed on iPads. That project kinda fizzled out. Or at least the iPad idea did. I think they decided to just use Surface laptops for it. Either way, I kept the iPad.

I’ve used it for different stuff over the years. At this point, I’m using it as a quick way to access company email and MS Teams at home, when my laptop is turned off. Teams has kinda turned into a work phone replacement for us now too. Nobody ever uses our internal phone system anymore, since we’re all on hybrid schedules. Everyone just uses Teams audio to call. So it’s convenient for that.

Of course, it’s not really necessary; I can always access email and Teams on my laptop. But I can’t leave my laptop on and connected to VPN 24/7, and it takes so long to boot it up and go through all the connection stuff that I would never check my email or Teams in my off-hours if I had to do it that way. So the iPad is kinda necessary, if I want to be accessible outside my normal work schedule. And it’s really useful for picking up a Teams call even during work hours.

But it’s from 2016, and is too old to be upgraded to iPadOS 16. And that should be fine, since iPadOS 15 is fine, and Apple is still releasing security updates for it. But my company uses Microsoft Intune to manage mobile devices, and I started getting emails recently telling me that I had to update it to 16.1.1. Initially, it looked like they had backed off on that and would support 15.7.1. But then I started getting the email notices from Intune again, and support confirmed that they would only allow iPadOS 16. (As a side note, I suspect that they could probably support both, but just don’t want to…)

So my initial plan here was just to trade in the old iPad for a new company-owned one. My boss approved that, but the mobile support guy told me that the company does not issue iPads, only iPhones. I could have gone down a rabbit hole here, arguing my case, or trying to find a way to get one through our internal Apple sales team. (We resell a lot of Apple devices, so I could have probably wrangled a slightly damaged customer return or something like that.) But I decided that would be an uphill battle, and it would just be easier to buy one myself.

My initial plan was to buy myself a new iPad for personal use, then repurpose my current personal iPad as a work iPad. That seemed like a good idea, but, looking at new iPads, I saw that I’d have to spend around $600 on an iPad that was equivalent or better than the one I have now, and I didn’t really want to do that. I eventually settled on buying a “scratch and dent” 2019 iPad from Woot for $200.

So now I have a 2019 7th gen iPad for work, and a 2019 iPad Air for personal use. Hopefully, both of them will keep working for awhile.

I spent a ridiculous amount of time setting up the new work iPad yesterday. The “easy” setup method, where you put the old iPad next to the new iPad, and the setup process tries to copy stuff over via Bluetooth (or whatever) got stuck. I gave it a few hours, and it didn’t time out or give me any errors, but it clearly wasn’t working. I eventually gave up and set it up as a new iPad, and then updated it to iPadOS 16.

I then had to go through the bureaucracy necessary to get it enrolled in Intune. That wasn’t too bad, though I did have to open a support ticket, since it didn’t work the first time I tried. And they haven’t removed the old iPad from Intune, so I’m still getting stern warning emails about updating it to iPadOS 16.

I’m wondering what I should do with the old iPad now, since they told me that they don’t want it back. It’s still in perfect working order, except for not being upgradeable to iPadOS 16. I guess I should just hand it in to Apple for recycling, but maybe I can find someone who wants a free iPad.

Messing with this stuff has also got me thinking again about the semi-permeable membrane between personal stuff and work stuff. It’s funny how that distinction has gotten blurred over the years, with BYOD programs and WFH, but how it’s now getting more distinct, with all the security measures we’ve been putting in place lately. Intune enforces a bunch of requirements now, such that I would never want to enroll my personal-use iPad or iPhone in the company MDM program. I use a separate iCloud account for the company iPad, and I’m really leery about doing anything with a personal account on a company device or vice versa nowadays.

So I guess I’ve succeeded in writing a long and rambling blog post on iPads, and can now get up and go out for a walk. It was a little below freezing when I started writing this, and is now a little above freezing, so I guess it’s warm enough for a walk now.

Programming Potpurri

I’ve been meaning to write a blog post or three about some of the programming-related stuff that I’ve been doing at work recently. But I keep putting it off. I’ve got some energy today, and a little spare time, so I’m going to try to write up some random notes.

Razor Pages

A while back, we had an old SharePoint 2013 page stop working. The page uses a control that I wrote in C#. The control really has nothing to do with SharePoint; it’s basically an old-fashioned ASP.NET web form that makes some web service calls, populates some controls, gathers user input, then makes another web service call, then redirects the user to another page. The only reason it’s in SharePoint is… well, that’s complicated. Let’s not get into that!

Anyway, fixing the page would take about five minutes. I’m pretty sure all I needed to do was increase a timeout, and increase the max receive size on a certain web service call. But… my SharePoint development VM got nuked in our security incident back in July. So the actual time to fix the error would be more like several days, since, at this point, I have no clue how to build a SharePoint 2013 development machine from scratch. I’m pretty sure I could do it, but it would take a lot of time and effort.

So I decided to just rebuild the page as a single-page ASP.NET Razor Page project, which seemed like it would be a fun thing to do, and might be a good model for moving some other stuff out of SharePoint. At the time, I wasn’t too busy. Of course, that changed, and now I kind of regret diving into this. But I did, and managed to learn enough about Razor to get the page done and into production.

I’d known a bit about Razor already, and had messed around with it on and off over the last few years. But most of my recent ASP.NET work has been web services, so there’s no need for Razor there. First, I was surprised to realize that Razor has been around since 2010. Scott Guthrie’s blog post announcing it is from July 3, 2010. I’ve still been thinking about it as “new,” but I guess it’s not. Heck, I guess it could even be considered “legacy” by some folks. (I guess maybe Blazor is what the cool kids are using now?)

Since it’s been around awhile, there are some reasonably good resources out there for learning it. But, also since it’s been around awhile, a lot of it is scattershot, or out of date, or not really relevant to what I was doing. The best resource I found is the Learn Razor Pages site. I almost bought the related book, ASP.NET Core Razor Pages in Action, but before I got around to it, I was pretty much done with the project, and had to move on to other stuff.

Dynamics 365

So, with the changes that are going on at work, it looks like I’ll have to be doing a lot more work with Dynamics 365. D365 is a pretty big topic. It looks like I’ll probably be mostly concerned with Dynamics 365 Sales (formerly known as CRM). I took a three-day class on Power Platform back in 2020, which is kind of the underlying technology for D365. Power Apps and Dataverse in particular are important. (The terminology on this stuff is really annoying. When I took that class two years ago, Dataverse was called “Common Data Service” and some of the other related terminology was different. It’s hard to keep up…)

I now have Pluralsight and LinkedIn Learning access via work, so I watched some videos on those sites, and on Microsoft’s Learn site, to refresh my memory from previous efforts to learn this stuff, and pick up on the new stuff. I guess I’m now almost at the point where I could be useful…

VSTO and EWS

Related to all that, I’ve been assigned to work on an Outlook plugin that ties into D365, and a console app that does some back-end processing related to the plug-in. So now I also need to learn VSTO, which is how the add-in was built, and EWS, which is used in the console app.

VSTO is a bit out of date, but not yet deprecated. If I was going to do a major rewrite on the plug-in, I’d probably switch to Office Add-Ins, which is a bit more modern, I guess.

And EWS is also out of date but not yet deprecated. If I wanted, I could probably move from that to the Graph API.

The main thing I need to do with these projects is to get them to work with Exchange Online. (We’re in the middle of migrating from on-prem right now.) I think I won’t actually have to change the plug-in at all, since it’s working with the Outlook object model, and I don’t think that cares if the email came from Exchange Online or on-prem. There might be a “gotcha” or two in there, though, so I need to at least test it.

For the console app, EWS still works with Exchange Online, but I know I’ll have to change a few things there, including switching over to OAuth for authentication.

And both apps seem to need some cleanup in terms of logging and error-checking. I know that if I make changes to these apps, then people are going to start coming to me with support questions, so I’ll need to make sure I have enough logging to provide support.

There’s actually been a lot of overhead involved in getting up and running on this project. These programs were originally under a different dev group, part of which has gotten moved into my group, so they’re using some conventions and utilities and stuff that I don’t know, and need to learn (and in some cases, gain access to). And I don’t have Outlook on my dev VM, since that’s not normally allowed (for security reasons). And I can’t get to the Exchange Online version of EWS, since that’s blocked (for security reasons). And I need to set up a new app registration, so I can access EWS with OAuth, and that needs to be approved by a global admin. And so on.

Was there a point to this?

If there’s a point to all this, I guess it’s just that I need to keep learning new things and being flexible. I saw a funny comic strip recently about an old man whose doctor tells him that he can help keep his memory sharp by learning new skills. And the old man says that his memory isn’t good enough for him to learn new skills. And of course I can’t remember where I saw that strip now, so I can’t link to it here. It was probably on GoComics, which I recently re-subscribed to, after canceling my subscription almost a decade ago. I’ve decided that reading the comic strips every morning is healthier than browsing Facebook and Twitter, so that’s why I re-subscribed. (I may also sign up for Comics Kingdom too, but that’s a subject for a different blog post.) Anyway, since I can’t find the strip I was looking for, here’s a different one, along similar lines.

Visual Studio extensions and alternatives

Another (relatively) quick post for today: It just occurred to me that, since my work VM has been restored from an older backup, the changes I made to Visual Studio a week ago are all gone. And that’s fine. I wasn’t entirely convinced that CodeRush was something I wanted to stick with anyway.

Since my VM is a little messed up now, I’ve been thrashing around a bit the last few days trying alternate ways to test some stuff out. I have some PowerShell scripts that I usually run on my VM, and I thought it would be fairly easy to copy them over to my laptop or desktop and run them there. But the specific set of modules I need is apparently a little complicated, and I haven’t been able to exactly recreate my environment. I’m sure I could, given time, but oh well.

Then I came up with the idea of installing LINQPad on my desktop and running some stuff there. That wasn’t terribly hard to do, but I’m referencing some DLLs in those that aren’t on my desktop, and, again, recreating the specific environment I needed got a bit too complicated and I gave up. That did get me thinking about upgrading my Pro license to a Developer license, so I’d have nuget support. I might still do that, but not right away.

And, finally, I have been looking at JetBrains Rider a bit lately. I noticed last week that their prices have gone up. Rider is still pretty affordable though. The old price was $139 for the first year (for personal use); the new price is $149. As a subscription product, that’s still enough that it’s not an impulse buy for me. I’d have to know that I was actually going to use it consistently, outside work. But lately I’m not doing enough programming outside work to justify it.

Visual Studio extensions and tweaks

I’ve been spending some time at work recently messing around with my Visual Studio setup. I’ve been fine with my current setup for awhile, but I started getting restless recently. I guess it started when I started reading Clean Code, and watching the associated videos. That got me thinking about automated refactorings, which got me looking at JetBrains Rider and Resharper. And looking at Resharper reminded me of the existence of CodeRush.

I’ve occasionally thought about trying out something like Resharper or CodeRush, but I never got around to it. There are a number of reasons for that, mostly around the cost and the possible performance penalty. But I noticed recently that CodeRush is now available for free, so I figured I’d give it a shot. (And I think Roslyn made it easier for extensions like CodeRush to work without a big performance penalty.)

My normal VS setup, which I’ve stuck with for a while now, is pretty basic, with Mads Kristensen’s Web Essentials, and DPack Rx. I use DPack primarily for the numbered bookmarks, and Web Essentials for a number of random things. CodeRush includes numbered bookmarks, so I thought I’d try removing DPack, installing CodeRush, and seeing how that worked out. So far, I’ve found that CodeRush’s numbered bookmarks don’t work quite as well as DPack’s. There are a number of other interesting features in CodeRush, but I’m not sure if any of them are compelling enough for me to keep CodeRush installed.

I also briefly considered uninstalling Web Essentials, and then just reinstalling the specific extensions from that collection that I’m actually using. But I couldn’t quite talk myself into that, so I’ve still got the whole collection installed.

On a related subject, I recently listened to an episode of .NET Rocks with Mads Kristensen on VS 2022 extensions. And another one with Mark Miller (author of CodeRush). I’m not currently subscribed to .NET Rocks in my podcast client, but I do check in on it occasionally to see if there’s anything interesting.

Getting back to the general subject of VS extensions and setup, I also revisited my work setup and tried to decide if I could switch from VS 2019 to VS 2022. I do my VS development at work on a VM that’s running Windows Server 2012 R2. That probably seems weird, but it’s necessary for Dynamics AX development. And VS 2022 isn’t supported on Server 2012, though I could probably get it to work. So I’ve been going back and forth on whether or not I should try to install it on my current VM, or maybe ask my boss for a new Windows 10 VM to use for VS 2022. I’ve decided to stick with VS 2019 for now, but I may need to ask for a new VM at some point. In part because I have a .NET 5 project in VS 2019, and .NET 5 is no longer supported. And .NET 6 isn’t supported in VS 2019. So it’s all kind of complicated. Asking for a new VM shouldn’t be a big deal, but I’m a little nervous about it, since I just got a new boss, and I’m now in a different sub-division of the IT department, and the rules about this stuff might be a little different than they were under the old boss, so I want to feel things out a bit before I start asking for stuff.

I did install VS 2022 on my personal laptop back in May. I do like it, and would love to be able to switch over to it. (Unlike some previous versions of VS, they don’t seem to have made any really bad UI decisions that make me want to stick with the older version…)

I also spent a little time messing with the default font in VS on Friday. I’ve stuck with Consolas for quite some time now. But  I was watching a LinkedIn Learning video on Friday where the teacher’s setup was using Cascadia Code, and it looked kind of nice. I’d read about Cascadia Code when it came out, but I never got around to trying it. So I switched over to it for a little while, but then decided to switch back to Consolas. The whole code ligature thing is interesting, but Consolas just seems to work better for me.

All of this fiddling around made me think about the balance between sharpening the saw and… pointless procrastination. (It’s bothering me that I know that there’s a clever metaphor similar to “sharpening the saw” that basically means “pointless procrastination”, but I can’t remember what it is.)

Well, I’ve now killed a bunch of time on a hot Saturday morning, drinking iced coffee, waiting on my grocery delivery, and writing a rambling blog post. My plan for the rest of the day revolves mostly around watching the last two episodes of Stranger Things on Netflix. Life is good, I guess.

Clean Code, Visual Studio, Windows 11, and a bit more on ebooks

I wanted to add some more notes about the whole Kindle, EPUB, MOBI, etc. thing that I’ve been blogging about in my last few posts. As I mentioned a few posts back, I’ve been working my way through the Clean Code learning path in O’Reilly. Since I’m probably going to lose access to O’Reilly before I’m done with that, I thought I’d buy a copy of the Clean Code book, so I could finish reading it at my leisure, and to have it for later reference. With tech books, I usually like buying a DRM-free ebook directly from the publisher, when possible. In this case, I initially had some trouble finding that, but eventually figured out that it’s purchasable through the InformIT site. I bought the Robert C. Martin Clean Code Collection ebook, which contains both Clean Code and The Clean Coder. I had a discount code, so it was about $40 total.

I copied the EPUB, MOBI, and PDF files for the book to OneDrive. There are a number of ways I can read an ebook on my iPad, if it’s DRM-free and available in multiple formats. For this one, I wound up sending it from OneDrive into my Kindle app, as a MOBI file. That method still doesn’t support EPUBs. And it will copy the file up into my Kindle library, which is nice. I don’t think I’d ever copied anything into the Kindle library that way before, but it worked fine. I also copied the PDF into GoodReader. The code listings in the MOBI version look a little weird, which is a common problem with tech ebooks, so it’s nice to have the PDF handy as an alternative.

Clean Code has some example refactorings that are fairly interesting. They’re all in Java, but I thought it might be interesting to take the original Java code for one of the examples, convert it to C#, get it working, then work through some refactoring that’s similar to what Uncle Bob does in the book/videos. I found some of the code for the examples in GitHub under the Clean Code Kata user account. (I’m not sure if that’s an “official” account for Bob Martin or his organization, but either way, the code is there.)

This idea to convert some of the examples to C# and work through them was prompted in part by a desire to set up a .NET dev environment of some sort on one of my personal machines, and to maybe experiment a bit with some of the more recent .NET stuff, like .NET 6 and VS 2022. I realized that I don’t currently have any dev stuff at all set up on my desktop PC, my MacBook, or my Lenovo laptop. The MacBook is new, so I just haven’t set any dev stuff up yet. The Lenovo was bought in 2020, and I haven’t gotten much use out of it at all. And I’ve been trying to keep the desktop PC free of any heavyweight dev tools, since I just want to keep it clean for personal productivity stuff. After going back and forth on a few possible setups, I decided to install Visual Studio 2022 (Community edition) on my Lenovo laptop. I considered just installing the .NET 6 SDK and Visual Studio Code, which would have been much more lightweight, but I’m used to using the full VS product, and I can’t see a reason not to use it. And the Lenovo is the best place to install it, since I can wipe out that machine entirely and start fresh if things get too messed up. I’ve also recently upgraded that laptop to Windows 11, so this was also an opportunity to (finally) give that a try.

Of course, I’ve had other things to do this weekend too, so I’ve only gotten as far as installing Visual Studio and git, and tweaking some settings. Maybe I’ll actually do some programming next weekend. (Or maybe I’ll get distracted by something else, and the whole thing will fall by the wayside.)