Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

80 total results found

C# Unit Tests with Async Task Signature

.NET

When writing unit tests, it’s good to standardize as much as possible.This includes the method signature for each test cases, such as this: // Test_1_1_1 Describe the test... [TestMethod] public async Task Test_1_1_1() { // Do some testing... ... ...

unittests
dotnet
.net
programming
testing

Unit Test Cheat Sheet

.NET

Here’s a list of elements for unit testing in Visual Studio using MSTest. Documentation for Visual Studio Testing is here: GitHub - microsoft/vstest-docs: Documentation for the Visual Studio Test Platform. Necessary Packages The following packages are neces...

unittests
testing
dotnet
.net
programming

C# Unit Test Template Classes

.NET

If you are using MSTest as your testing framework, and want to leverage the test functionality from OGA.Testing.Lib, here are the minimal classes and structure you will need. For a cheat-sheet on MSTest framework usage, see this: Unit Test Cheat Sheet Depend...

programming
.net
testing
unittests
dotnet

.NET Framework Unit Testing Issues

.NET

Since we have some libraries that still output to NET Framework targets, some workarounds are required because of some design choices that have been made in the MSTest library and Test Explorer. MSTest Project Styles (SDK vs Non-SDK) NOTE: This only applies ...

dotnet
testing
programming
.net
unittests

.NET iOS Runtime Limitations

.NET Xamarin

Here’s some notes on the limitations imposed by IOS for Xamarin and MAUI applications. These apply to both Xamarin and MAUI apps written for iOS. Basically, the iOS kernel prevents any application from generating dynamic code at runtime. So, any usage of JI...

Xamarin
dotnet
.net
programming

PostgreSQL DotNet DataType Mapping

.NET

Here’s a list of .NET datatypes, and how best to store each one. .NET Datatype PostGreSQL DataType datetime (UTC) timestamp without time zone Guid uuid float real double double precision ...

programming
database
postgres
.net
dotnet

PostgreSQL Bulk Insert

PostgreSQL

Here’s a means to insert multiple records in a single insert call, which is about 40 times faster than performing an explicit insert for each row. We will leverage the BeginBinaryImport method on the database connection class of the NPGSQL library. To make t...

postgres
database
programming
.net
dotnet

Missing AspNetCore Nuget Packages

.NET

There are several aspects of an ASP Net Core web API that cannot be placed in a class library without a little extra care. This is because Microsoft decided to remove “many of the core assemblies” from nuget packages for the ASPNetCore, when Net Core 3.0 was p...

nuget
dotnet
programming
.net

VS Project Conditional Constants

.NET

When developing cross-platform libraries, you will have the need to enable and disable different parts of your source code based on what statements or functions work on each platform. For example: Processes are queried differently in Windows than linux.And, c...

.net
programming
dotnet

.NET Core In-Memory Cache

.NET

Here is a working method for using the In-Memory cache. For a thread-safe cache update, see the example at the bottom. Assimilate this into a working project: In-Memory Caching in ASP.NET Core - Code Maze Understanding & Implementing Caching in ASP.NET C...

programming
dotnet
.net

How To Add Release Notes to Nuget Package

.NET

These are the steps needed to include release notes in a Nuget package. These are taken from this article:Writing a NuGet package release notes in an outside of a .csproj file. Same article here:Writing a NuGet package release notes in an outside of a .csproj...

nuget
programming
dotnet
.net

.NET How to Create and Publish Nuget Package

.NET

Taken from here: docs.microsoft.com-nuget/docs/quickstart/create-and-publish-a-package-using-the-dotnet-cli.md at main · NuGet/docs.microsoft.com-nuget Here is more content on additional properties for a nuget package: docs.microsoft.com-nuget/docs/referenc...

programming
nuget
dotnet
,net

Nuget Package Reference

.NET

Here’s the golden reference for all things Nuget: docs.microsoft.com-nuget/docs at main · NuGet/docs.microsoft.com-nuget How to publish NuGet symbol packages using the new symbol package format '.snupkg' Non-Trivial Multi-Targeting with .NET Multi-targetin...

nuget
programming
dotnet
.net

Code Signing Cert Setup

System Administration Code Signing Token Setup

Each time you receive a new code signing certificate on a USB eToken, there are steps to perform and information to collect, so it can be utilized in an automated build pipeline. There is little comprehensive documentation available on the web, for how to eas...

Administration
programming
deployment

HowTo: Create a New Cloud Service or Library

.NET

Current as of: 20250126 This list will be revised as more steps get automated. This is a working list of manual steps that cover the genesis to deployment of a new cloud service, library, or app. It includes steps to define, document, create, configure, aut...

deployment
programming

NET Core Background Services

.NET

NOTE: Refer to this page for how to register and consume a background service: Consuming NET Core Background Service with DI General Lots of the ceremony of a background service has been wrapped up and tested, in this class: BackgroundService_Base NOTE: As ...

service
programming
dotnet
.net

Getting Correct Scheme, Host, Port Behind a Proxy

.NET

When running an API behind a reverse proxy, such as NGINX, the service will not, by default, see the scheme and port of the incoming call. By default, the API service will see the scheme and port of the direct call to it, which will likely be http and some int...

nginx
dotnet
.net
programming

How to Create IOptions Instance

.NET

It’s pretty standard for classes to require configuration in their constructors in the IOptions form.But, this doesn’t make testing very easy. Here’s a workaround for pushing an IOptions instance into a class constructor, that needs config. This example is f...

dotnet
.net
programming

IServiceProvider vs IServiceScopeFactory

.NET

References: Net Core DI Truths Internet’s Claim of Anti-Patterns Contrary to what the internet says about service locator usage as anti-pattern, there will always be the need for logic to dynamically access services from DI.This is because the NET Core runti...

DI
dotnet
programming
.net

Net Core DI Truths

.NET

References: NET Core DI Best Practices Here’s a list of behaviors of the NET Core DI registry: All dynamic access to services (from DI) are requested through a service provider.This is what people call a service locator. For example:var foosvc = _servic...

.net
DI
dotnet
programming