I was looking for a fun project to do this holiday season and decided that it’s about time to put my Raspberry Pi to good use. The idea is to build a device that will measure temperature, humidity, and barometric pressure in an apartment. Then, send this data to Azure and have an app written in .NET MAUI to view this data. These will be a series of articles on how to do all that with Raspberry Pi 4 and .NET 6.
In this part, I’ll go over writing a program to take measurements of temperature, humidity, and barometric pressure using Raspberry Pi. Let’s get started!
I was looking for a fun project to do this holiday season and thought that it’s about time to put my Raspberry Pi to good use. I’ve decided to build a device that will measure temperature, humidity, and barometric pressure in an apartment. Then, send this data to Azure and have an app written in .NET MAUI to view this data. I’ll split this in the series of articles on how to do it with .NET 6 and Raspberry Pi 4. In this part, I’ll describe the setup of Raspberry Pi for .NET 6 development and write a basic “Hello World” app. Let’s get started!
In my project at work we use NamedPipe as one of the telemetry transports when running the app locally. All seemed to work fine, until I decided to write a BenchmarkDotNet diagnoser for the application that was supposed to use NamedPipe telemetry transport to collect certain metrics.
A few days ago I stumbled across a C# code that was rethrowing the exception by means of passing captured exception object as an argument of the throw keyword (
throw ex;). Such a pattern of rethrowing the exception can turn an exercise of troubleshooting a production issue into a game of “Find where the exception happened.”. I had to play this game a few times in my life and it is not the most fun game to play, especially if your codebase is quite large. So, here I want to take a minute and discuss what is the correct way to rethrow the exception in .Net.
Razor sections allows us to write a block of code in one view and render it later in another. The typical example would be the
scripts section that takes a script block from the page and renders it in the layout after all common scripts. This works fine until you try to use
sections from the partial view or from the display template.
The AspNet Core 2.1-preview1 is out and it brings a ton of interesting improvements. One of which is that now you are able to host your AspNet app inside the IIS process. This, according to AspNet team will increase the request throughput by around 4.4 times. I did it for my app and faced a few issues that I though is worth describing here along with a process that I followed.
Recently I was migrating a CI script from VS 2015 tools to VS 2017 tools. The script was calling to vstest.console.exe to run integration tests, somewhat like this:
I’ve omitted the error handling code here for simplicity. The call itself is quite simple, it relies on the fact that when you install Visual Studio build tools on the CI machine it adds an environment variable
VS140COMNTOOLS that points to the Visual Studio tools folder, usually it is
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\.
Recently I got a task to create a reporting tool that will aggregate data from VSTS and provide reports on the team performance in terms of finished work items and pull requests. I was excited about this, because I saw this as an opportunity to use Telerik’s data grid in the real world scenario.
This might sound like a very simple thing to do, just right click -> “Add References” -> Select an assembly and done. Even easier, just add a NuGet package. Well, not quite. When I added a NuGet package to one of my extension projects I got a runtime error that took me some time to figure out. So I though it might be a good idea to write about it.
Generally it’s a good idea to specify a “Datasource template” for sitecore rendering. It gives your users a great benefit of creating datasource items right from the “Associate content” dialog and also it will allow them to select items of this template only. This works just fine, until you get to a point when your rendering has to accept items of different types (templates) or even better, you want to be able to create items of different types right from the “Associated content” dialog.