<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>&gt;NET Core on Bryan Avery</title><link>https://bryanavery.co.uk/categories/net-core/</link><description>Recent content in &gt;NET Core on Bryan Avery</description><generator>Hugo -- gohugo.io</generator><language>en-GB</language><copyright>© 2026 Bryan Avery.</copyright><lastBuildDate>Wed, 05 May 2021 12:44:09 +0000</lastBuildDate><atom:link href="https://bryanavery.co.uk/categories/net-core/index.xml" rel="self" type="application/rss+xml"/><item><title>Hosted Background timer task</title><link>https://bryanavery.co.uk/hosted-background-timer-task/</link><pubDate>Wed, 05 May 2021 12:44:09 +0000</pubDate><guid>https://bryanavery.co.uk/hosted-background-timer-task/</guid><description>&lt;p&gt;If you need a background task within .Net Core to be run at set times we can use the Hosted Service provided from the service within .Net Core.&lt;/p&gt;&#10;&lt;span id="more-1511"&gt;&lt;/span&gt;&#10;&lt;p&gt;A timed background task makes use of the &lt;a href="https://docs.microsoft.com/en-us/dotnet/api/system.threading.timer"&gt;System.Threading.Timer&lt;/a&gt; class. The timer triggers the task’s &lt;code&gt;DoWork&lt;/code&gt; method. The timer is disabled on &lt;code&gt;StopAsync&lt;/code&gt; and disposed when the service container is disposed on &lt;code&gt;Dispose&lt;/code&gt;:&lt;/p&gt;</description></item><item><title>Hosting a service inside ASP.NET Core</title><link>https://bryanavery.co.uk/hosting-a-service-inside-asp-net-core/</link><pubDate>Wed, 05 May 2021 09:47:17 +0000</pubDate><guid>https://bryanavery.co.uk/hosting-a-service-inside-asp-net-core/</guid><description>&lt;p&gt;A little hidden gem within .Net Core is the ability to run a Hosted Service inside the application. This allows for your service to run in a different thread to the main application, but keeps everything together though the need to host a separate service.&lt;/p&gt;</description></item><item><title>ILogger in .NET: best practices</title><link>https://bryanavery.co.uk/ilogger-in-net-best-practices/</link><pubDate>Fri, 23 Apr 2021 09:55:32 +0000</pubDate><guid>https://bryanavery.co.uk/ilogger-in-net-best-practices/</guid><description>&lt;p&gt;If you are like me you will have been using ILogger in DotNet Core for some time, but you’ll have noticed there are many ways to use the logger, I found this useful article by &lt;a href="https://blog.rsuter.com/" rel="noreferrer noopener" target="_blank"&gt;Rico Suter&lt;/a&gt; going over some recommendation and best practices.&lt;/p&gt;</description></item><item><title>ASP.NET Core Guidance</title><link>https://bryanavery.co.uk/asp-net-core-guidance/</link><pubDate>Tue, 30 Jun 2020 07:02:30 +0000</pubDate><guid>https://bryanavery.co.uk/asp-net-core-guidance/</guid><description>&lt;p&gt;I came across a very good article on ASP.NET Core which I needed to bookmark, as it gives a clear and understandable guidance on keeping things working as efficiently as possible.&lt;/p&gt;&#10;&lt;span id="more-1424"&gt;&lt;/span&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/davidfowl/AspNetCoreDiagnosticScenarios/blob/master/AspNetCoreGuidance.md"&gt;https://github.com/davidfowl/AspNetCoreDiagnosticScenarios/blob/master/AspNetCoreGuidance.md&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Here is a copy of the post&lt;/p&gt;</description></item><item><title>Health Checks</title><link>https://bryanavery.co.uk/health-checks/</link><pubDate>Sun, 19 Apr 2020 11:11:59 +0000</pubDate><guid>https://bryanavery.co.uk/health-checks/</guid><description>&lt;p&gt;Using DotNet Core comes some responsibilities, one of those is making sure your application is up and running.&lt;/p&gt;&#10;&lt;p&gt;Since DotNet Core 2.2 the introductions of health checks have been established.&lt;/p&gt;&#10;&lt;p&gt;There are two types of Health Checks&lt;/p&gt;</description></item><item><title>Sample .NET Core Docker file</title><link>https://bryanavery.co.uk/sample-net-core-docker-file/</link><pubDate>Thu, 20 Feb 2020 15:20:23 +0000</pubDate><guid>https://bryanavery.co.uk/sample-net-core-docker-file/</guid><description>&lt;p&gt;Here is a working example of a simple Docker file for a .NET Core 3.1 project&lt;/p&gt;&#10;&lt;pre&gt;&lt;code&gt;FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env&#10;WORKDIR /app&#10;&lt;p&gt;COPY project.csproj ./&#10;RUN dotnet restore&lt;/p&gt;&#10;&lt;p&gt;COPY . ./&#10;RUN dotnet publish -c Release -o out&lt;/p&gt;&#10;&lt;p&gt;FROM mcr.microsoft.com/dotnet/core/runtime:3.1&lt;/p&gt;&#10;&lt;p&gt;WORKDIR /app&#10;COPY &amp;ndash;from=build-env /app/out .&lt;/p&gt;&#10;&lt;p&gt;ENTRYPOINT [&amp;ldquo;dotnet&amp;rdquo;, &amp;ldquo;project.dll&amp;rdquo;]&lt;/code&gt;&lt;/pre&gt;</description></item></channel></rss>