System.MissingMethodException: 'Method not found: 'Boolean System.MemoryExtensions.ContainsAny(System.ReadOnlySpan`1<!!0>, System.Buffers.SearchValues`1<!!0>)'.'

Developer 60 Reputation points
2023-08-07T02:30:56.5333333+00:00

I am using .Net 8 preview 5. I am trying to install nuget packages

Microsoft.Extensions.Logging.ApplicationInsights

Microsoft.Extensions.Logging.AzureAppServices

But getting the error in program.cs file for the below line

var builder = WebApplication.CreateBuilder(args);

System.MissingMethodException: 'Method not found: 'Boolean System.MemoryExtensions.ContainsAny(System.ReadOnlySpan1<!!0>, System.Buffers.SearchValues1<!!0>)'.'

I have removed all the other nuget packages and I am sure, the error is coming only for these packages.

Note: I have used these packages in .Net 6 and working fine. But I wanted to make it work for .Net 8

Developer technologies ASP.NET ASP.NET Core
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.