Having upgraded an ASP.NET Core project from .NET7 to .NET8, I got an error when trying to publish it. This blog post is my note to remind me how to fix it
Category: <span>Visual Studio</span>
Undocumented way of running a command before or after a publish in Visual Studio.
Another excuse to have a laugh at the expense of some very clever Microsoft engineers!
Whilst Hot Reload is a great feature of Visual Studio, I found that it was very slow in on specific project, often taking 30-60 seconds before the changes were applied.
This post describes the cause of the problem, and briefly discusses some solutions.
My frustration at not being able to find some Blazor project templates in Visual Studio, and how I discovered the dumb stupid reason why.
With a couple of recent projects, I have been using Azure DevOps instead of my usual SVN for source control. This uses Git, and whilst the mind migration to Git has been generally painless, there have been a couple of points that keep tripping me up. One of these is convincing Git that the .gitignore file has changed. When you start a new project in Visual Studio, and use Team Explorer to connect to Azure DevOps, it automatically adds everything to Git, including the bin and obj folders. You generally don’t want to put these under source control. No problem, crack up the .gitignore file and add the following lines… Visual Studio sometimes creates this for you, but even if it does, you still need to modify manually if you add a new project, as it doesn’t seem to do that for you. So, you confidently hit the refresh button…
Whilst editing a WPF view, the XAML designer claimed it couldn’t display a child user control due to a null reference exception. Looking at the stack trace, I noticed a wonderfully named method…
A few (hopefully) useful links to debugging tactics that aren’t so well known, but are extremely powerful.
Following on from my previous posts with great error messages, here are some more
I kept having problems when I opened a XAML file, in that the designer would show the following… This makes it somewhat hard to design a view when you can’t see the design! It turns out that when the XAML designer loads, it attempts to run code in your view model. There is some (questionable) justification for this, but overall, it’s a huge pain, and is one of the reasons why editing XAML files can be such a slow and tedious process. However, there is a way to mitigate the problem. If you can identify which parts of your code are causing issues, you can add code to prevent them from running when you are in Visual Studio. First you need to add the following line to the top of your code file… …then wrap the offending code in a check as follows… Apart from the fab method name (who…
Leave a Comment