Best way to force an update of a transitive nuget package dependency?

The best way to force an update of a transitive Nuget package dependency is to update the directly referenced package to a newer version that includes the updated transitive dependency Open the Package Manager Console in Visual Studio. You can do this by going to Tools > NuGet Package Manager > Package Manager Console. Run … Read more

Convert .Net Framework 4.6.2 project to .Net core project

This appears to be an official Microsoft resource for doing the migration. Summarized below: (recommended) Retarget all projects you wish to port to target the .NET Framework 4.7.2 or higher. (recommended) Use the .NET Portability Analyzer to analyze your assemblies and see if they’re portable to .NET Core. (recommended) Install the .NET API analyzer into … Read more

How can I uninstall dotnet core from macOS Sierra

To uninstall dotnet core from macOS: download dotnet-uninstall-pkgs.sh from https://github.com/dotnet/sdk/blob/main/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh make dotnet-uninstall-pkgs.sh executable execute dotnet-uninstall-pkgs.sh as root (requires superuser privileges to run). curl -O https://raw.githubusercontent.com/dotnet/sdk/main/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh chmod u+x dotnet-uninstall-pkgs.sh sudo ./dotnet-uninstall-pkgs.sh

Is it possible to run .NET Core on Raspberry PI?

I have managed to run .NET Core 2 app on Raspberry PI 3 with Raspbian. I have followed https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md and https://github.com/dotnet/core/issues/447: On my laptop: Install .NET Core 2.0 SDK Run mkdir helloworld cd helloworld dotnet new console Edit helloworld.csproj <Project Sdk=”Microsoft.NET.Sdk”> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.0</TargetFramework> <RuntimeIdentifiers>win-arm;linux-arm</RuntimeIdentifiers> </PropertyGroup> </Project> Run dotnet publish -r linux-arm On Raspberry PI … Read more

How do you filter xunit tests by trait with “dotnet test”?

I found the answer (only tests attributed [Trait(“TraitName”, “TraitValue”)] are executed): dotnet test –filter TraitName=TraitValue Alternatively, you can filter by not having a trait value (tests attributed [Trait(“TraitName”, “TraitValue”)] are execluded from run) dotnet test –filter TraitName!=TraitValue In my example above, this means I can run: dotnet test –filter Color=Blue More docs here: https://github.com/Microsoft/vstest-docs/blob/master/docs/filter.md

Use HttpClientFactory from .NET 4.6.2

All of the Microsoft.Extensions.* packages target .NET Standard 2.0. That means that you can use Dependency Injection, Configuration, Logging and HttpClientFactory if you add the appropriate package to your application. You need to add Microsoft.Extensions.Http to use HttpClientFactory and Microsoft.Extensions.Http.Polly if you want to use it with Polly To configure HttpClientFactory you’ll have to add … Read more

What is the right way to fix error NU1605: Detected package downgrade – log4net

According to Microsoft, this can be resolved by adding the following to your csproj. <PackageReference Include=”Microsoft.NETCore.Targets” Version=”3.0.0″ PrivateAssets=”all” /> https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1605#issue-1 “Certain combinations of packages which shipped with .NET Core 1.0 and 1.1 are not compatible with each other when they are referenced together in a .NET Core 3.0 or higher project, and a RuntimeIdentifier is … Read more

How to publish results using dotnet test command

You can see all the dotnet test options by executing dotnet test –help. One of the options is -l, –logger, which gives some great information: Specify a logger for test results. Examples: Log in trx format using a unqiue file name: –logger trx Log in trx format using the specified file name: –logger “trx;LogFileName=<TestResults.trx>” More … Read more