Format JSON in Sublime Text 4
I like Sublime Text 4 as a fast and versatile editor. Unfortunately, I always forget the command to format JSON files. This is mainly because it takes more steps than one single key combination:
I like Sublime Text 4 as a fast and versatile editor. Unfortunately, I always forget the command to format JSON files. This is mainly because it takes more steps than one single key combination:
GemBox.Document is a great help when you need to work with Microsoft Office documents in .Net. It gives you one simple interface to interact with DOCX, DOC, PDF, PDF/A, HTML, XPS, RTF, TXT and XML files – all without the hassle of Office interop objects.
For our light-weight data synchronisation tool we need to disable all triggers and constrains on our tables until the data is consistent again. In SQL Server we can use these commands to disable everything, do our work and then reactivate the checks and triggers:
If you need to copy multiple values from one document to another, you can go and copy & past every value on its own. That works, but there is a better and faster way. Windows 10 comes with a well-hidden clipboard history that you already have on your machine. With this feature you to copy multiple values and then past them to the target document in the order you need to – no 3rd party software required.
In a .Net Full Framework application we could use the property SpecifiedPickupDirectory in our mailSettings and the emails got stored to disk instead of sending them to the recipient. That allowed us to check them manually or in our test code.
For .Net 5 you should no longer use System.Net.Mail.SmtpClient and instead use MailKit. However, testing is a lot harder then MailKit does not offer such a convenient way to dump your emails to disk. Let us explore what we can do to check that our applications send the right emails.
SmtpClient from System.Net.Mail was the way to send emails in .Net 4.x. This old class worked for our use cases well enough to not bother finding an alternative. However, as the time progresses, email protocols improved while SmtpClient stayed the same. If you look at the .Net 5 documentation for SmtpClient, you find this important note from Microsoft:
Important We don't recommend that you use the SmtpClient class for new development because SmtpClient doesn't support many modern protocols. Use MailKit or other libraries instead. For more information, see SmtpClient shouldn't be used on GitHub.
Last week I discovered an annoying Microsoft "feature" on my laptop. After a long holiday and a few Windows updates, Microsoft Word was gone. I could not find the application anywhere and my computer was unwilling to open any *.docx files. A quick Google search showed that I am not alone. But how do I get Word back?
If you persist a DateTime property to SQL Server you lose a tiny bit of precision. For most use cases this will go unnoticed. However, if you try to compare two objects as part of an integration test, your test will fail. Let us look how we can work around the different timer precisions between .Net and SQL Server in Fluent Assertions.
Azure DevOps allows you to add multiple Git repositories to the same project. That allows you to set the permissions only once and organise your code as you like. Sooner than later, you try to add a second backlog and that is where things get complicated. This feature is well hidden and easy to overlook.
If your code works on the Continuous Integration (CI) server but not on your local machine, you may have a problem in the files not tracked by Git. And since Git does not track them, there is no easy way to get rid of them - at least in most Git clients. In such cases, we can go to the command line and use the full feature set of Git to fix the problem.