Failed to find a valid digest in the ‘integrity’ attribute for resource in Blazor app

This is an annoying issue indeed and I’m getting that error every now and then. It seems to happen after updating some packages, and the build processes fails to pick up the new SHA for the package. You can verify that this is the issue by finding the file containing the SHAs and compare the … Read more

Using appsettings.json to configure Kestrel listen port Dotnet core 2 preview 2

As mentioned in a comment on the accepted answer, 2.1 has support for appsettings.json, see https://blogs.msdn.microsoft.com/webdev/2018/02/02/asp-net-core-2-1-roadmap/#security A working appsettings.json: “Kestrel”: { “EndPoints”: { “Http”: { “Url”: “http://localhost:5555″ } } } This is for a Program.cs using (created by “dotnet new webapi”): WebHost.CreateDefaultBuilder(args) Relevant source code in GitHub https://github.com/aspnet/MetaPackages/blob/master/src/Microsoft.AspNetCore/WebHost.cs#L163 options.Configure(builderContext.Configuration.GetSection(“Kestrel”)); and https://github.com/aspnet/MetaPackages/blob/master/src/Microsoft.AspNetCore/WebHost.cs#L169 config.AddJsonFile(“appsettings.json”, optional: true, reloadOnChange: … Read more

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

Is .NET Core Runtime backwards compatible with previous releases?

Edit .NET Core 3.x SDK has been released. Unlike v2.2 and the previous releases before it, this version does not support the ability to target previous runtimes (i.e. netcoreapp2.2, netcoreapp2.1, etc) tldr; Yes. By installing .NET Core Runtime 2.2.3, you can run apps which target netcoreapp2.0, netcoreapp2.1, and netcoreapp2.2, without requiring additional runtimes to be … Read more

EF Core One to One or Zero Relationship

Here .HasForeignKey<Person>(a => a.PersonID) you are telling EF that Person.PersonID will be a FK (foreign key) to Address, i.e. Person is dependent and is referencing the principal Address. It should be other way around: .HasForeignKey<Address>(a => a.PersonID) This way, Person (the principal) will have 0..1 Address, and Address (the dependent) will have 1 Person (because … Read more

.NET Core equivalent of CallContext.LogicalGet/SetData

Had this problem when we switched a library from .Net Framework to .Net Standard and had to replace System.Runtime.Remoting.Messaging CallContext.LogicalGetData and CallContext.LogicalSetData. I followed this guide to replace the methods: http://www.cazzulino.com/callcontext-netstandard-netcore.html /// <summary> /// Provides a way to set contextual data that flows with the call and /// async context of a test or invocation. … Read more

The term ‘Add-migration’ is not recognized – VS2017 and EntityFrameworkCore

The solution that worked for me after trying a whole raft of other solutions posted, was to: right click on my project select Manage Nuget Packages select the browse tab thick Include prerelease check box install the Microsoft.EntityFrameworkCore.Tools N.b that aspnetcore project in visual studio 2017 do not seem to have the project.json file.

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