Task Creation Revision
Dependency Injection in a WPF MVVM Application
Avoiding async void
Windows SDK to OS Version
- Windows 11
- 10.0.26100 24H2
- 10.0.22621 22H2
- 10.0.22000
- Windows 10
- 10.0.20348 2104
- 10.0.19041 2004
- 10.0.18362 1903
- 10.0.17763 1809
Nuget.Config
Set repositoryPath
and globalPackagesFolder
to ensure that all project references point to the new path.
Environment variables need to be cleared as they’ll override Nuget.Config
.
NuGet Packages Location Settings Precedence
NUGET_PACKAGES
User environment variableNUGET_PACKAGES
System environment variable%APPDATA%\NuGet\NuGet.Config
fileconfig/globalPackagesFolder
setting%ProgramFiles(x86)%\NuGet\Config
fileconfig/globalPackagesFolder
setting
Check current location (new terminal needed for environmental variable change):-
nuget locals global-packages -l
- DEV: How to change default Nuget packages folder on Windows
- StackOverflow: Dotnet Nuget/package folder very big and for each user
- MS Learn: Managing the global packages, cache, and temp folders
- MS Learn: Common NuGet configurations
- MS Learn: nuget.config reference: config section
MAUI Dependency Injection
High Performance UDP sockets in .NET 6
C# 12: Collection expressions and primary constructors
All About Span: Exploring a New .NET Mainstay
Windows "Show Password" Keyboard Shortcut
Alt + F8
How to set up Windows 11 with a local account
During Windows setup:-
- Shift + F10 to open command prompt.
- Enter
oobe\bypassnro
command. - Setup will restart with “I don’t have internet” option at network selection.
Create a Windows 11 VM without TPM
When you see the screen indicating that your PC can’t run Windows 11, press Shift + F10 to open the Command Prompt.
Saving Aranet4 data to Raspberry Pi
Simple Guide | Pi-hole on Raspberry Pi with IPv6
Using a Raspberry Pi as a Print Server
Setting up CUPS isn’t necessary with the current Raspberry Pi OS image. Working drivers for ARM are the main problem.
- How to share a USB printer in WiFi with a Raspberry Pi?
- Raspberry Pi Print Server: Setup a Network Printer
- AskUbuntu: Finding device printer's device URI during driver installation
- Raspi StackExchange: Can't get Brother HL-L2300D printer to print from Raspberry Pi
- Raspi Forums: Getting Brother-Printer drivers to work
- How to set up a remote printer which is attached to a Raspberry Pi (or any other ARM computer)
- OpenPrinting: Brother HL-2130
- GutenPrint
- Reddit: Compile x86 .deb printer drivers into arm7 raspberry pi .deb
- SuperUser: Debian ARM and Brother DCP195C with CUPS
- How to Use Your Brother Printer with CUPS on Raspberry Pi
MS Office Outlook: Default Attachment Save-As Location
Add DefaultPath
string value to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Outlook\Options
. %UserProfile%
works here.
Mastering DOM manipulation with vanilla JavaScript
via Michael Tsai
Windows Explorer Context Menu 'Open with VS Code'
paint.net plugins - Windows Store version
Plugins are supported for the Store release. You just have to install them in a different location. Go to your Documents folder, create a folder called “paint.net App Files” (no quotes though), and then create a folder for each plugin type: Effects, FileTypes, and Shapes. And then put your plugins into each folder just like you’re used to with the Classic release. This does mean that plugins are installed per-user, mind you. This method of installation is also supported by the Classic release, by the way.
IcoCur plugin for paint.net
paint.net forum post
Construct your Windows app's icon
Windows 11 scale factor | 100% | 125% | 150% | 200% | 250% | 300% | 400% |
---|---|---|---|---|---|---|---|
Context menu, title bar, system tray | 16px | 20px | 24px | 32px | 40px | 48px | 64px |
Taskbar, search results, Start all apps list | 24px | 30px | 36px | 48px | 60px | 72px | 96px |
Start pins | 32px | 40px | 48px | 64px | 80px | 96px | 256px |
Note
Apps should have, at the bare minimum: 16x16, 24x24, 32x32, 48x48, and 256x256.
This covers the most common icon sizes, and by providing a 256px icon, ensures Windows should only ever scale your icon down, never up.
Advice for Operating a Public-Facing API
via Michael Tsai
StackOverflow: Run git commands from a C# function
With PowerShell
StackOverflow: How to create WPF System Tray Icon when no "Main" host window exists
In .NET 5+ set <UseWPF>true</UseWPF>
and <UseWindowsForms>true</UseWindowsForms>
in the project file.
StackOverflow: How to create md5 of string with powershell without using stream
StackOverflow: How to convert an image to an icon without losing transparency?
Gravatar Image Requests
Gravatar C# API
Git Global User
- User
- Get:
git config --global user.name
- Set:
git config --global user.name {display name}
- Clear:
git config --global user.name ""
- Get:
- Email
- Get:
git config --global user.email
- Set:
git config --global user.email {email address}
- Clear:
git config --global user.email ""
- Get:
Font Icons in .NET MAUI
Using .NET User Secrets
MAUI App Title Bar on Windows 10
Custom Fonts & Material Design Icons in .NET MAUI
Upgrade a Xamarin.Forms app to .NET MAUI with the .NET Upgrade Assistant
try-convert Tool
Tool to migrate .NET Framework projects to .NET “Core”.
How to lock your Raspberry Pi Screen
How to start using .NET Background Services
Windows UI Library in the Windows App SDK (WinUI 3)
Windows Application Packaging
- StackOverflow: What is Windows Application Packaging Project for?
- Deployment overview
- Packaged, Unpackaged and Self-Contained WinUI 3 Apps with the Windows App Sdk
- MSIX: The Modern Way to Deploy Desktop Apps on Windows
- MSIX: Probably you don't know, but you are already using it
- Features that require package identity
- Integrate your desktop app with Windows using packaging extensions
Messenger
.NET Configuration
Add/Remove Tabs Dynamically in WPF
Using the contents of a file to define an MSBuild property
All About Span: Exploring a New .NET Mainstay
Upgrading your .NET projects with Visual Studio
How to disable Bing button in Microsoft Edge?
- Create
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge
Key - Create
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\HubsSidebarEnabled
DWORD - Open
edge://policy/
in Edge and clickReload Policies
to check setting applied
The weird world of Windows file paths
How to Sign PowerShell Script (And Effectively Run It)
CRLF vs. LF: Normalizing Line Endings in Git
Solving common problems with Kubernetes
SVG Tutorial
ReaderWriterLockSlim Class
Xamarin Forms Themes And Styles
Introducing .NET MAUI
String to Lines
Multiple Command Parameters
Jekyll
Xamarin Pop-up Form
LINQ Group by Month, Sum and Count
Bing Maps
Understanding the Whys, Whats, and Whens of ValueTask
Android App Data Files
WPF ItemsControl
UWP Tile Notification
UWP Background Tasks
PowerShell vCard split
Hex <--> int
Entity Framework
- EF doesn’t support unsigned types. Use long for uint.
[DatabaseGenerated(DatabaseGeneratedOption.None)]
attribute to turn off auto generated keys.DbContext.Table.RemoveRange(from c in DbContext.Table select c)
to clear table. Or((IObjectContextAdapter)DbContext).ObjectContext.ExecuteStoreCommand("TRUNCATE TABLE [Table]")
for quick and dirty.[Key]
attribute to define primary key- Use
[Table("[Table]")]
on class for table name
- https://msdn.microsoft.com/en-us/library/jj193542%28v=vs.113%29.aspx?f=255&MSPPError=-2147217396
- https://stackoverflow.com/a/20184709/146360
- https://msdn.microsoft.com/en-us/library/jj591583%28v=vs.113%29.aspx?f=255&MSPPError=-2147217396
- https://stackoverflow.com/a/21885745/146360
- https://msdn.microsoft.com/en-us/library/jj200620%28v=vs.113%29.aspx?f=255&MSPPError=-2147217396
- https://stackoverflow.com/questions/20203492/entitytype-has-no-key-defined-error
- https://social.msdn.microsoft.com/Forums/en-US/648f9f5f-b844-48cb-85c3-74c8f2ee87cc/entity-framework-code-first-stop-autoincrement-and-use-my-primary-key?forum=adodotnetentityframework
- https://stackoverflow.com/questions/26303631/how-to-use-unsigned-int-long-types-with-entity-framework
App Custom Maps
UWP Logging
- https://stackoverflow.com/questions/32886613/logger-for-windows-10-uwp-app
- https://github.com/serilog/serilog
- https://docs.microsoft.com/en-us/windows/uwp/monetize/log-custom-events-for-dev-center
- https://github.com/Fody/Anotar
- https://stackoverflow.com/questions/30543689/how-to-use-serilog-with-unity
Removing characters which are not allowed in Windows filenames
SyndicationClient.RetrieveFeedAsync returning error
UWP Localisation
XAML Styles
UWP File Access
- https://docs.microsoft.com/en-us/windows/uwp/files/fast-file-properties
- https://docs.microsoft.com/en-us/uwp/api/windows.storage.storagefile.properties
- https://docs.microsoft.com/en-us/windows/uwp/files/quickstart-managing-folders-in-the-music-pictures-and-videos-libraries
- https://docs.microsoft.com/en-us/uwp/api/windows.storage.search.queryoptions
- https://docs.microsoft.com/en-us/uwp/api/windows.storage.storagefolder
Xamarin Auth
Xamarin Android Context
StackOverflow: Bind two checboxes to a nullable bool property in MVVM
UWP Icons
UWP Device Enumeration
UWP Background Transfer API
Grid View Item Templates
Events with async/await
Xamarin Dropbox
- https://www.dropboxforum.com/t5/API-Support-Feedback/OAuth2-0-throws-invalid-grant-type-message-while-fetching-the/td-p/268801
- https://trevorhartsblog.com/2018/03/05/xamarin-android-dropbox-api-v2/
- https://www.dropboxforum.com/t5/API-Support-Feedback/How-do-I-set-the-Redirect-URI-port-number/td-p/243556
- https://stackoverflow.com/questions/41525569/xamarin-equivalent-to-webauthenticationbroker-getcurrentapplicationcallbackuri
- https://github.com/dropbox/dropbox-sdk-dotnet
Xamarin Azure
Xamarin UWP Debug
‘In the Core Project (.NET Standard Project) Properties > Compilation > Advanced > Select “PDB Only”’
Xamarin Navigation
ILMerge
Doesn’t work with .NET Core dlls due to pdb format
- https://peteris.rocks/blog/merging-net-assemblies-with-msbuild/
- https://github.com/Microsoft/ILMerge
- https://stackoverflow.com/questions/10137937/merge-dll-into-exe
- http://dotnettower.blogspot.co.uk/2014/12/visual-studio-post-build-event.html
- https://stackoverflow.com/questions/2556048/how-to-integrate-ilmerge-into-visual-studio-build-process-to-merge-assemblies
- https://github.com/Microsoft/ILMerge/issues/11
- https://stackoverflow.com/questions/3106855/build-with-ilmerge-error
Custom domains on GitHub Pages gain support for HTTPS | The GitHub Blog
Common UI Patterns in Xamarin Forms – Part 2 – Tabbed Pages
Creating a hamburger menu in Xamarin.Forms
Xamarin Forms Toolbar
Xamarin Custom Controls
Xamarin FontSize
Xamarin
Xamarin Icons
Wpf Togglebutton
Using WPF styles
WPF ProgressBar
Observable
ListView.ItemContainerStyle
StackOverflow: How to use binding in the ListBox’s Items to the ViewModel’s properties
Uwp Navigation
"Disabled" TextBlock
CollectionViewSource
CSS Truncate Text
StackOverflow: Superscript in CSS only?
StackOverflow: String format using UWP and x:Bind
CSS Tables
CSS List
CSS Layout
CSS Background
C# Rx Socket
LINQ Join
Wpf Could not load file or assembly System.Net.Sockets
Add to wpf project file
WPF Page in Frame
WPF Localisation
- http://putridparrot.com/blog/localizing-a-wpf-application-using-locbaml/
- https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/wpf-globalization-and-localization-overview
- https://wpf.2000things.com/2014/07/28/1123-localization-iv-download-and-build-the-locbaml-tool/
- https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/how-to-localize-an-application
- https://wpf.2000things.com/2014/07/24/1121-localization-ii-assigning-uids-to-all-localizable-elements/
StackOverflow: C# String Format for hours and minutes from decimal
XAML Binding
UWP ComboBox
UWP Adaptive Layout
Async/Await
- StackOverflow: The application called an interface that was marshalled for a different thread - Windows Store App
- StackOverflow: The application called an interface that was marshalled for a different thread in window 8
- StackOverflow: using await inside setters
- StackOverflow: Passing an *Awaitable* Anonymous Function as a Parameter
- StackOverflow: Correct way to get the CoreDispatcher in a Windows Store app