- August 2025 — AzCopy Authentication FAILED (2 Hours)
-
I tried combinations of instructions on
This Page
to authorise against my Azure Active Directory subscription so that the
azcopy.exe
utility would run easily from the command line without the tedious bother of appending a SAS token. Nothing works. In one case I was prompted to enter my credentials, but my personal account was rejected. Another attempt to set the service principal failed due to lack of permissions, but despite stuffing around with permissions in the portal I could not get it to work. After a couple of hours of idiotic failure I lost the will to live and gave up. - August 2025 — Blazor in IIS SOLVED (3 days)
-
I write a small .NET 8 Web API and Blazor app pair and publish them to my home Windows 2025 server for local testing. They both give Error 500.19
code 0x007000d. Search results suggest my web.config file is not recognised and some support software might be missing. I have the
.NET SDK installed, but after hours of searching it's
revealed that I also need to manually install the
Runtime Hosting Bundle.
Now the Web API app is working, but Blazor gives a different 500 error. More searches tell me to install the
IIS Rewrite Module which I do, and now the error
is a 404 and it can't browse the directory. More clues reveal that I need
index.html
as one of the default documents, which I add and now it's all working. - July 2025 — Project is broken SOLVED (3 hours)
-
A Blazor net8.0 project won't compile or run by any means in Visual Studio. It was updated and published several weeks earlier and has
been untouched since then. I get incomprehensible errors that produce no useful search results. Two days later I try to run the project ...
and it works! Two days later I try to run the project and I get a different set of incomprehsible errors. More search results produce lots
of suggestions that all don't work. An AI generated list suggests I delete the hidden
.vs
folder, which I do ... now it's working perfectly. I would have eventually stumbled upon this fix, as deleting the.vs
folder has fixed occasional project problems in the past, but I'll admit that the AI suggestion did save me some time. Another example of a non-deterministic developer experience. - July 2025 — Azure Storage Explorer forgetting credentials SOLVED (many weeks)
- Azure Storage Explorer one day many weeks ago started to forget all the account credentials, so at least once a day I'd need to tediously enter all the credentials again. An AI suggestion was to use the Help > Reset Authentication command. I did that, and it simply deleted all the accounts. I tediously recreated all the accounts, and so far the values seem to be remembered okay.
- July 2025 — Blazored.Modal FAILED (2+ hours)
- I expended over 2 hours trying to make a modal popup dialog appear in a simple Blazor app using the Blazored.Modal library. I carefully watched the whole definitive Blazor Train video and some other similar ones in an attempt to duplicate their code and make it work, but absolutely f***ing nothing worked. After overcoming incomprehensible compile errors by replacing the CascadingParameter with a standard injected service, no popup is displayed and I get a stall on the await of the Result. The downloaded GitHub sample project works correctly, so there is some subtle difference in my own code that's fouling things up, but what?! This is another good example of why I want to retire from the stinking IT business.
- July 2025 — NETSDK1136 SOLVED (2+ hours)
-
While simply wanting to test a piece of C# code, I used the Visual Studio 2022 'new project' wizard to create a skeleton WPF project.
I pasted the small amount of code in and hit Run and I got this primary compile error (and many other cascading errors):
The target platform must be set to Windows (usually by including '-windows' in the TargetFramework property) when using Windows Forms or WPF, or referencing projects or packages that do so.
- June 2025 — Upgrade Assistant Stalls SOLVED (3 months)
-
The .NET Upgrade Assistant has worked for me
many times in the previous few years. Earlier this year I noticed the extension simply ran forever and did nothing when running against a project in Visual Studio,
and from the command line it showed a selection option and remained unresponsive forever. I gave-up on the VS extension and expended an hour of guesswork before
I finally found a version of the command that correctly upgraded a 4.8 project to net8.0. The command requires all of the parameters like this example to work:
upgrade-assistant upgrade MyOld48.csproj --targetFramework net8.0 -o Inplace
. - May 2025 — Project Resource files SOLVED (1 hour)
- I had some files in a VS2022 net8.0 project with Build action set to Resource, but they were not found at runtime and ILSpy showed they were not in the output Assembly. It took a while to realise that Resource is only meaningful in a WPF project where they are compiled into something like name.g.resources, but I was in a library project and I should have used Embedded Resource instead and read them with GetManifestResourceStream. My fault for mixing-up project types in my head.
- May 2025 — WPF command binding problem SOLVED (15 years)
- Since 2010 I have suffered a seemingly random problem where WPF command CanExecute code would not run when property values changed. It turns out it was caused by raising events on a worker thread. The issue is explained in detail in this Wiki article.
- May 2025 — Using NetworkStream SOLVED (many days)
- I was finally forced to exchange client-server string messages using the TcpListener and TcpClient classes. As many conflicting pundits have discussed online, reading a NetworkStream is a fragile and error prone process. After days of experiments I accepted the wise advice that you need to invent a protocol for the exact format of binary messages being exchanged. This is explained in my Wiki article Using NetworkStream.
- April 2025 — WebView2 overlay WORKAROUND (2 hours)
-
After some confusion I discover that the WebView2 control in my WPF application is overlaying everything visible in the app Window no
matter where it's positioned in the visual tree (confirmed HERE).
Someone suggests using WebView2CompositionControl, but I find it depends on Microsoft.Windows.SDK.NET 10.0.17763.10.
There is no exact package matching that name, but I try the closest ones with a variety of versions, but all I get is
In the end, no sensible solution was found. As a workaround I hid the tab containing the WebView2 when necessary to show other controls.NETSDK1135: SupportedOSPlatformVersion 10.0.26100.0 cannot be higher than TargetPlatformVersion 7.0.
It gets worse, then better ... When I installed my WPF app using the WebView2 on customer machines, it silently crashed because the runtime for the control was not found, and the only solution was to install the runtime (which didn't work for me) or package 250MB of runtime files with the installer. After a few days mental rest I realised that I could just revert to the traditional WPF WebBrowser control, which works perfectly. I believe the WebView2 control wraps around a more modern HTML rendering engine, but it's a pain in the arse and can go to hell while I happily use the old control.
- April 2025 — Mathematica //N default digits SOLVED (34 years)
- In Mathematica, the expression N[√10] normally gives you 3.16228. In fact, by default, any machine precision calculation gives you six digits of output, which I considered a rather dismal default for such a powerful product. I always wondered why Mathematica's default behaviour wasn't more like a pocket calculator where you always get about 10-digit results. For decades I casually tried to find a way of changing the default number of result digits, but no luck. I thought there might be a $Global variable to change the behaviour but couldn't find one. Today I found the answer HERE. It's a Preference titled Number of digits displayed in output. I set the value to 15 so I seee all the useful digits in a native 8-byte floating-point number.
- April 2025 — WPF Drop into TextBox SOLVED (1.5 hours)
- In a demo WPF desktop application I wanted to drop a TreeView node into a TextBox. I have used drag-drop occasionally without problems, but this was the first time the target was TextBox and no events fired over the target. Intensive diverse experiments failed and no videos covered having a TextBox as the target. After more and more searches I finally found a clue that it was necessary to catch the PreviewDragOver event where you inspect the e.Data, set the e.Effects as required and you must set e.Handled = true;. I've never needed to use the Preview event before, but I get the impression that dropping into a TextBox is something of a special case. How would you know?!
- April 2025 — Publish Fails SOLVED (1 hour)
- My Blazor project in Visual Studio will not publish by any means. It was okay earlier in the morning. What the hell happened? I'm getting weird errors like server status 500 from the failed Azure publish. As usual, I search and search and run lots of failed experiments. Almost by accident I realise it's my fault because I had recently copy-pasted some csproj xml elements from a different project into this one, and I accidentally included the line <IsPublishable>False</IsPublishable>. No wonder it wouldn't publish, but why didn't I just get the message "This project is not publishable"? That would have saved time.
- April 2025 — Azure FTP SOLVED (1.5 hours)
- One morning I find I cannot make an FTP connection to my Azure web app to upload new files. It's been working for several years without a hiccup, so what's wrong? I try all sorts of FTP variations, check settings and parameters, try tracing, run searches, etc, but absolutely nothing makes any difference. I eventually guess that something in my specific Azure account is simply rejecting the connection. Browsing through all the Azure portal blades I eventually see under Configuration that FTP Basic Auth Publishing Credentials is Off. Why? I can't even remember that setting and I certainly wouldn't be stupid enough to turn it off. Why is it off? I turn it back on and everything returns to normal.
- April 2025 — Incremental Code Generators ABANDONED (3 hours)
- In late 2020 Microsoft released a feature of the Roslyn compiler which allowed source code generation during the compile process. I discuss some experiments with this feature in my November 2021 post, where (at the time) I decided it was an elegant extension to the compiler, but it was so incredibly difficult to use correctly compared to quickly slapping together a T4 template. The code generation API has expanded and mutated in recent years and I discovered the new cool way to generate code was by using the Incremental Generators API. I spent a few solid hours studying the Cookbook and many other articles and examples on the subject in the hope that I could replace some of my old T4 templates with an Incremental Generator. Firstly, the Cookbook example don't work and don't explain which project language or target should be used … most of the examples are subtly different and use different APIs and techniques … there is no way to debug the generator to learn what values are available … it's just a confusing and increbidly complicated mess. If I was tasked with writing a reasonably complex generator for production use, then I estimate it would take 40+ hours of research and experiments. I'm retiring, so I have no compelling reason to become a generator boffin and live through the inevitable suffering. So for now, incremental code generators can go to hell.
- March 2025 — T4 Templates in .NET Core SOLVED (4 hours)
-
If a T4 template in a Visual Studio project attempts to "touch" a .NET Core Assembly it will fail with reference errors. This wouldn't normally happen,
but in my case I was dynamically loading an Assembly so I could reflect over it and generate code. The Assembly was recently changed from targeting
netstandard20 to net80, so I hit the problem.
A modernised TextTransformCore.exe was released in
June 2023, but they state that in-IDE or MSBuild tasks
are not supported yet, and after an hour of experiments in March 2025 I sadly confirm that it's still a limitation. Therefore the only viable technique
remaining is to use the tool from a command prompt to manually process the .tt file. You can't have $(ProjectDir) style variables in the .tt file because there
is no way for the tool to resolve their values (using <T4ParameterValues> doesn't work). My bat file in the solution folder looks like this, and it uses
the ‑r switch to tell the processor where the dynamically loaded Assembly is found:
"%ProgramFiles%\Microsoft Visual Studio\2022\Professional\Common7\IDE\TextTransformCore" MyTemplate.tt ‑r bin\Debug\net8.0\MyAssembly.dll
I pray that they will integrate the new T4 tool into the VS IDE and build processing soon, but I'm worried that Microsoft will put more effort into urging people to use Rosyln Source Generators instead. As I say in my C# Compiler Source Generators post a few years ago, writing generators is fragile, tedious and complicated compared to knocking-out a .tt file.
- March 2025 — Publish Blazor App SOLVED (4 hours)
-
I need to publish a Blazor app with small changes to match those in a web service it calls. The project fails to compile due to a missing project.assets.json file.
An hour of web searching for a fix produces a dozen suggestions that are either nonsensical or have no effect. Cleaning folders, restoring packages and workloads, etc,
nothing works (and some ran for 20 minutes). It looks like some net60 environment change in my work PC has broken the build process.
Out of desperation I upgrade from net60 to net80 and update all the packages and publish settings to match. Now it compiles and runs, but publishing still fails.
I eventually see a clue:
the following workloads must be installed: wasm-tools-net8
. I run the commanddotnet workload install wasm-tools-net8
and restart Visual Studio, now it publishes. - March 2025 — Update Chrome SOLVED (1.5 hours)
- I try to install Adblock Plus in Chrome on my work PC and it says that Chome is too old. I attempt to update Chrome and it fails with some hex code ending in 2. The update is repeated a few times with several elevation prompts (which seem to work), but the error is unchanged. I login as local Administrator, which for some reason causes 2 minute pauses between logoff and logon. Update continues to fail. I download the Chrome installer and run it, and the update seems to work, with only one elevation prompt. I restart Chrome and it requests another update, which luckily this time downloads and installs without error. I log back on as my regular user (after a 2 minute stall black screen) and start Chrome and my home page fails to load because all the network shares are dead. I reboot and now Chrome seems to be updated and working normally. Now I can install Adblock Plus, which also removes the garish ads plastered by default all over popular news web sites.
- March 2025 — PC Speakers fault FAILED (1 hour)
- The small Logi z213 speakers on my wife's PC stop working. After an hour of experiments I determine that the wire inside the sealed plastic on the stereo jack is loose, as wiggling it around causes the sound to stop and start. The right speaker is stuck on half volume. This is a classic case of an SPF, a Single (Stupid) Point of Failure that can't be repaired and it renders the whole device practically useless. The $70 speakers only lasted about one year.
- February 2025 — Visual Studio 2022 Licensing SOLVED (5 hours)
-
Azure Storage Explorer was telling me that some accounts needed reauthentication, which I did and it seemed to work.
About an hour later I launch Visual Studio 2022 and it tells me that my trial period has expired. I spend an hour entering my usual credentials
over and over and over, but the problem remains unchanged. I notice that the account dialog says:
This product is licensed to: wrong address
. For another hour I search for how to change the license address, or cancel it, or do anything useful. The next day, with a fresh mind I bumble into a fix by changing the Account Options > combo Windows authentication broker to Embedded web browser, relaunching VS, entering my credentials again, which causes everything to come good and the Accounts screen is sensible and shows no alerts. I then revert the combo and relaunch VS, which causes more authentication prompts, but they are also finally satisfied and all problems are solved with the original settings restored. By looking at some files in %TEMP%\servicehub\logs I see Could not find a WAM account message which lead to This Community Issue which is solved using exactly the same workaround that I used by dumb luck. - February 2025 — Dynamic C# Source Compile SOLVED (3 hours)
-
in July 2014 I posted an article titled
Dynamic C# code compilation
where I use the CSharpCodeProvider class to compile C# source code at runtime, then invoke a method inside the generated Assembly.
Unfortunately that technique only works in the full .NET Framework and is deprecated in .NET Core. I went looking for modern equivalent code so I
could udpate the post. After two hours of searching I found several samples that all did not work for various reasons, even the MSDN sample code produced
a PlatformNotSupportedException, and the docs confusingly confirmed that was expected for .NET Core 2+. I eventually found some (non working) sample code
that used the CSharpCompilation and related classes, which I tweaked and almost worked. It produced compile errors like
Predefined type 'System.Object' is not defined or imported
because the basic references were not found. I eventually found the minimum required references to make the compile work. For more information see Dynamic C# Code Compilation. - January 2025 — PC Sound Problems SOLVED (2 hours)
- Playback through the line-out stops working and only the speakers in the screen work. All sound recording stops because Audacity says there are no input devices. After an hour of inspecting Windows settings and cables I discover that the power cable and another have been pulled out of the small mixer out of sight behind my screen. I think a cat got stuck behind my desk and got tangled in the cables trying to get out. I put all the cables back and reboot. Playback now works, but not recording. I stuff around with more settings in Windows and Audacity and after more than an hour of random stuffing around the recording device is visible and I can select it and recording works again.
- January 2025 — TV Sound Problems PENDING (2 hours)
- Our LG 55" TV only has two ways of playing sound: (1) HDMI-ARC which is typically used with a sound bar or similar (2) Optical out plug. We don't own a HDMI-ARC compatible playback device, just a $99 set of 5 speakers which have worked pleasantly for over 20 years using their ancient RCA plugs. Luckily, the cheap speakers have an optical input, but connecting it to the TV's optical out produces no sound. I have no way of determining which part is failing. We have no choice but to eventually buy a sound bar or something similar, but they cost anything from $200 to $2000 and it's just a burden of brainpower and money to choose something.
- January 2025 — .NET 9 Upgrade SOLVED (3 hours)
- Since .NET 9 had been out for a few months, I decided to bulk upgrade my main hobby suite named Hoarder from .NET 8 to 9. I did this purely as an academic exercise to keep up with the latest versions of everything and play with them. The upgrade wizard went through all 10 projects (including a Blazor one) and produced only a few low-level warning messages. The solution compiled okay first time. At runtime everything was working until I got to the WPF desktop program which died with an incomprehensible Exception deep inside the CodePage loading library. There were no matching results from web searches and I fiddled around for ages without success. I had run out of ideas and give-up in disgust. Six weeks later I revisited the problem, hit run on the WPF program and it ran perfectly. I don't know what was wrong and I don't know what went right.