Questions tagged [.net-5]

The previous version of .NET, successor of both .NET Core and .NET Framework. Use this tag for questions about .NET 5 and .NET 5's formal specification.

Filter by
Sorted by
Tagged with
0 votes
0 answers
37 views

Google authentication .Net 7

How do i migrate this .Net 5 code to .Net 7: services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(jwt => jwt.UseGoogle( clientId: &...
CHardin's user avatar
0 votes
1 answer
20 views

Uncaught (in promise) IntegrationError: Missing value for options: amount should be a number

const options = { mode: 'payment', amount: 1000, currency: 'inr', appearance, // Optional Style the Express Checkout Element }; // Pass ...
th0m6s's user avatar
  • 3
1 vote
1 answer
36 views

Troubleshooting Dependency Injection Error in .NET 5 API Background Task

The primary goal is to reload user account data at regular 30-minute intervals within a .NET 5 API. In pursuit of this goal, I learned something about implementing background tasks to automate this ...
Daniel's user avatar
  • 428
1 vote
1 answer
64 views

.NET Upgrade Hell

I have a web application in .NET 5, I want to upgrade it to the latest version of .net. I have VS 2019 and VS 2022 both installed, I have .NET 7.0 SDK (v7.0.400) installed. PS C:\proj> dotnet --...
serge's user avatar
  • 14.1k
-2 votes
1 answer
46 views

Different result when generate MD5 hash

This is my code: private static string ComputeMD5Hash(string input) { using (MD5 md5 = MD5.Create()) { byte[] inputBytes = Encoding.Default.GetBytes(input); byte[] hashBytes = ...
Mohammad 's user avatar
0 votes
1 answer
53 views

Autofac.Core.Registration.ComponentNotRegisteredException: The requested service 'ApplicationDbContext' has not been registered

I get an error at the starting of the application: An error occurred while trying to connect to the DB.(Myproj.Web.Program) Autofac.Core.Registration.ComponentNotRegisteredException: The requested ...
serge's user avatar
  • 14.1k
0 votes
1 answer
126 views

.NET Core 5 - Registering a class as singleton with strings in its constructor

I have a .NET 5 web application, in which I am attempting to register a particular class as a singleton instance. I know that .NET 5 is out of support now, and there are plans to upgrade this app in ...
garrett's user avatar
  • 31
1 vote
0 answers
72 views

I want to downgrade from net6.0 to net5.0

I want to use YoloV8 in my C# Project. My Project uses Net5.0 version but the YoloV8 in Nuget Library use Netv6.0. I've tried to change the TargetFramework Tag of the YoloV8 Library from net6.0 to ...
May Nong Nghiep Thong Minh's user avatar
0 votes
0 answers
9 views

client certificate from a .NET 5 site to an OwinRequest in a .NET 4.7.2 site via REST communication?

I'm trying to send a client certificate from a .NET 5 app using REST communication to a FW 4.7.2 app From .NET 5 application, I use HttpClientHandler adding client certificate from my storage of ...
user22257755's user avatar
0 votes
0 answers
147 views

How to find cause of IIS shutting down an app pool after only a minute or so

We have a .Net 5 web app we just launched recently. In the event log I'm seeing that the application pool keeps shutting down and restarting after anywhere from 30 seconds to a minute or so. I have ...
geoff swartz's user avatar
  • 5,475
0 votes
0 answers
31 views

AspNetCore.ReportingServices.RdlExpressions.ExpressionHostObjectModel. is not accessible in this context because it is 'Friend'

To the best of my knowledge, Microsoft currently does not have any plans to release an official Reporting Services/ReportViewer package for .NET Core. That's why, I am utilizing the third-party RDLC ...
Lukman Hakim Imran's user avatar
0 votes
0 answers
90 views

How to fix dbcontext concurrency problem with this code

The code below was originally written for Entity Framework 6 in a .Net Framework 4.7.2 MVC environment. We've recently moved our business logic, domain objects and data layers to .NetStandard 2 with ...
geoff swartz's user avatar
  • 5,475
0 votes
2 answers
70 views

How to Marshal a nested array of pointers in c#

Library uses nested array of pointer to struct, but result in an exception when using. When there is no nested array of pointers to struct paramB, then there is no exception. Original code for use of ...
gavioto's user avatar
  • 1,695
2 votes
1 answer
29 views

Is it worth migrating Dotnet Standard 2.1 to .Net 6 in specified scenario

Scenario: I am planning to upgrade a WebApi-based web project from .Net 5 to 6. I have many dotnet standard 2.1 class library projects in my solution. When trying to upgrade from EF Core 5 to 6 it did ...
Malik Khalil's user avatar
  • 6,485
0 votes
0 answers
125 views

Azure function stopped working, restarting every 30 minutes and after some time starts working as it should

I will try to explain everything that happened in the last month or so. Azure function in question is a timer trigger that is working on a crone job every 2 minutes. On Saturday 13th of May, at around ...
Nikola Nikolic's user avatar
0 votes
0 answers
35 views

Kendo Nested Grid name cannot be blank

I'm at a loss. I am trying to build a nested grid using Kendo ui tools. I have a very similar grid that works perfectly, but there is something missing in mine, as I keep getting a "Name cannot ...
9Snick4's user avatar
  • 31
0 votes
0 answers
123 views

ASP.NET Core 5 MVC : search bar for searching by name and ingredient

I'm building a cocktail bar app using ASP.NET Core 5 MVC and Entity Framework. I'm implementing the search bar functionality right now. I made it work that when I enter the name of a cocktail, it says ...
Dohn Joe's user avatar
2 votes
2 answers
363 views

DataDog logger doesn't log INFORMATION level

I have .NET 5 web app which is supposed to write logs to DataDog using Serilog Sink (Serilog.Sinks.Datadog.Logs v0.5.2). Here is my Program.cs: static async Task Main(string[] args) { using (var ...
Denis Kaminsky's user avatar
0 votes
0 answers
14 views

I am getting the following error while generating charts in RDLC report using AspNetCore.Reporting package. How to fix it?

**Could not load file or assembly 'System.Windows.Forms, Version= 4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified. ** I am getting this error while ...
Saqif Haque's user avatar
0 votes
1 answer
76 views

SignalR client's InvokeAync returns null

Per the MS documentation for InvokeAsync: The InvokeAsync method returns a Task which completes when the server method returns. The return value, if any, is provided as the result of the Task. And ...
Alex's user avatar
  • 715
0 votes
0 answers
60 views

Sharepoint Filter List Items

I have a list in sharepoint, and what i want to do is want to fetch the data using c#. I want it to return the value from sharepoint based on a condition. This is what have so far, public ...
Jseb's user avatar
  • 1,926
1 vote
0 answers
32 views

Log4net doesn't create a log file as using via private nuget package in .NET5

I have a simple Logger class library in .net 5 <TargetFramework>net5.0-windows10.0.19041.0</TargetFramework> The Logger logs by using log4net version 2.0.15 I created a simple .net5 ...
K.W's user avatar
  • 123
2 votes
1 answer
1k views

.NET 5 HttpClient: SSL connection could not be established, see inner exception

I am using HttpClient to get an image from a public url. I did a test in Postman and I can get it without any issues, as well as in my dev pc. When I publish it to production web server, I got the ...
Jio's user avatar
  • 97
0 votes
0 answers
45 views

System account login Cefsharp program crashes

We deployed a windows service in which cefsharp is used. Logging in with the system account for the service will crash, but there is no problem with the Administrator account. The following is ...
redz's user avatar
  • 1
0 votes
1 answer
251 views

How to use dbFactory with my dbContext base class instead of its derived classes

The application is .NET 5.0 with Blazor server side, Entity Framework Core and AspNetCore.Identity. Originally its code for setting up DbContext and IdentityContext used to look like this: // ...
ilya_i's user avatar
  • 333
0 votes
1 answer
78 views

Cannot find document with Date filter in C# using MongoDB.Driver

I'm trying to find document by exact datetime, but i got 0 as count. Here's my model: public class CubeDataModel { [BsonId] [BsonRepresentation(BsonType.ObjectId)] public ...
birsanzhar's user avatar
0 votes
1 answer
1k views

HTTP Error 500.31 - Failed to load ASP.NET Core runtime Common solutions to this issue: The specified version of Microsoft.NetCore.App in .Net 5

When I try to run basic ASP.NET Core 5 MVC project, I get this error: HTTP Error 500.31 - Failed to load ASP.NET Core runtime Common solutions to this issue: The specified version of Microsoft.NetCore....
Bahy's user avatar
  • 159
0 votes
0 answers
13 views

Partial view in Dotnet application not appearing

I am having trouble with partial view in dotnet application i have been following Pro ASP.NET Core Identity book of Adam Freeman (Apress) The Layout File look like the image below where i am calling ...
Assay Khan's user avatar
0 votes
1 answer
184 views

Slicer Filtering in power bi api not working as expected C#

I need to export a pbi report into pdf with slicer filters.  I have created an ExportReportRequest object and passed to await Client.Reports.ExportToFileInGroupAsync(GroupId,ReportId, exportRequest); ...
Muhammed Irshad's user avatar
-2 votes
1 answer
160 views

Getting Exception when filename has spaces in File.WriteAllBytes() c# [duplicate]

I have to use File.WriteAllBytes() to store the file contents. If file.Filename is a string without spaces it works fine (like "abc","sample"). But if file.FileName comes with ...
Muhammed Irshad's user avatar
0 votes
1 answer
176 views

AutoMapper map array of objects in response

Case: User can add meal and it's name, description, image and ingredients. User sends such payload { "ingredients":[ { "id":1, "name":"...
Michał Sawicki's user avatar
-1 votes
1 answer
54 views

Can't debug some subproject in microservice architecture

I have problem with debugging repository which consists of few subprojects, I add them as a reference projects, and if I add one, everything works just fine, but if I add 2 or more, then debug files (....
Bozhena Kondrat's user avatar
2 votes
1 answer
106 views

c# - .NET 5 Bootstrap MVC with value from a database (oracle)

For context purpose, I'm a complete beginner trying to learn something in my spare time. I want to implement a checkbox list using bootstrap, and the values in the checkbox list should come from a ...
dario59's user avatar
  • 33
0 votes
0 answers
138 views

Identity Toolkit signInWithPassword API Rate Limit

My system uses Firebase Authentication's Sign In with E Mail and Password. But i uses sms code for two factor authentication. users emails are their phone number. For example: +90 5xxxxxxxxx@example....
Fatih Dursun Üzer's user avatar
0 votes
0 answers
101 views

Images are not getting saved to database after .NET 6 upgrade

Recently we've upgraded our ASP.NET 5 Web API to .NET 6 along with all nuget packages and everything worked fine until we noticed that new images are no longer saved to our MySQL database. Any images ...
James Joubert's user avatar
0 votes
0 answers
29 views

CoreAdmin package is not working on .net 5 after following documentation

I'm using .net 5 and CoreAdmin 1.8.0, as I followed the available instruction on github I installed the package with dotnet add package CoreAdmin And added this line at the bottom of ...
Vala Khosravi's user avatar
0 votes
1 answer
203 views

ASP.NET Core 5 Web API : slow response for the first REST call

My ASP.NET Core 5.0 Web API (HTTPS) is running on Windows 7 SP1. The first HttpClient REST call (from a .NET 5.0 client) gets a very slow response, the next call is very fast, after a while (around 2 ...
geek175's user avatar
  • 107
0 votes
1 answer
179 views

Building a SAP Business One add-on using .NET >= 5 is officialy supported?

I cannot find any official document by SAP that states building a SAP Business One add-on using (both DI AND UI API) using .NET >= 5 is officially supported. I've tryed building a .NET 7 test add-...
Pao'lino's user avatar
5 votes
1 answer
131 views

.net 5.0 VS .net framework 4.6 different behavior

Notes this code, when run it in .net framework 4.6, only get "press any key.", but can get "config changed." in .net 5.0, why? public class Holder { public static ...
Mike's user avatar
  • 195
0 votes
0 answers
28 views

System InvalidOperation Exception Unable to resolve service for type 'Microsoft.AspNetCore.Identity.SignInManager`1

I am unable to get back a jwt token using postman. I get the below error message. I have recently migrated from .net 5 all the way up to .net 7. System.InvalidOperationException: Unable to resolve ...
GolfBravo's user avatar
  • 847
1 vote
2 answers
986 views

Upgrading .NET Core application from .NET 5.0 to .NET 7.0

I have a project which has a backend api on .NET 5.0 and a frontend on React.js. I'm trying to upgrade the project to .NET 7.0. This is the code from startup.cs which throws an exception after I ...
IntelligentCancer's user avatar
0 votes
1 answer
133 views

Blazor WASM: Get error from Http.ReadFromJsonAsync<string>: "The JSON value could not be converted to System.String."

I am using a Blazor WASM project with Hosted ASP.NET Core 5 WebAPI. When I try to deserialize the return of a method it brings this error. I have this ApiController that receives my Post public ...
ISeeMangos's user avatar
0 votes
0 answers
143 views

Add NetTopologySuite when configuring Oracle Dbcontext with Ef Core 5

I have a project with .Net 5.0 and Oracle is the databse provider. The version of the packages are: <PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.10" /&...
CalciferZero's user avatar
0 votes
1 answer
778 views

ASP NET Core 5 as windows service, service stops but process keeps running

I run an ASP.NET Core 5 API as a Windows service using IHostBuilder.UseWindowsService(). Consider following code block to be my Main() method: try { Log.Information("...
woutervanrobays's user avatar
0 votes
1 answer
93 views

Unknown error when publishing standalone WPF Net core 5 application from Visual Studio 2019 for linux x64

I'm trying to create a WPF Net Core 5 app from Visual Studio Community 2019 on Windows and publish it with standalone deployment mode (runtime included) for use on linux X64 without having to install ...
Raúl's user avatar
  • 1
1 vote
2 answers
220 views

GRpc protobuf generic client runtime

i'm trying to create a dotnet core 5 app with multiple GRpc clients/servers generated from protobuf files. One of the servers should act like a "master" to handle the life cycle of the whole ...
LuftWaffle's user avatar
3 votes
3 answers
403 views

How to add Startup.cs in existing project .net5

I have an .net5 project and in .csproj file I have this: <PropertyGroup> <TargetFramework>net5.0</TargetFramework> </PropertyGroup> I added Microsoft....
user avatar
1 vote
1 answer
948 views

Serilog text formatting to contain valid json output

I am logging with Serilog and have a (text) file sink with an output template and a console logger. The output template of the text file logger: "outputTemplate": "{Timestamp:yyyy-MM-dd ...
monty's user avatar
  • 8,008
0 votes
1 answer
117 views

Update Framework from 3.1 to 5 for Azure Function will raise this error "Could not load file or assembly Microsoft.Extensions.Configuration.Abstractio

I built an Azure Function and the Target framework was 3.1, so i change it to 5, as follow:- but after doing so, i start getting this error:- Could not load file or assembly 'Microsoft.Extensions....
John John's user avatar
0 votes
0 answers
177 views

c# SerialPort suddenly stops receiving data and unable to reopen

I have a curious problem that i cant make sense of. Here the facts: .net 5 Project published as arm32 linux self contained Running on a Raspberry pi Compute module in one case that we cant provoke ...
Ranndom's user avatar
  • 118

1
2 3 4 5
62