3,058 questions
0
votes
1
answer
92
views
Ignore Comma Delimiter in CsvHelper
I've a project that uses CsvHelper package to parse excel file. Unfortunately I came into a condition where I've to ignore comma as delimiter that CsvHelper does by default I believe. The data in a ...
0
votes
2
answers
87
views
Ignore Properties That Are Inherited From Base Class
I've a base class User that's used by EF Core and here's the configuration for that as follows:
public class UserConfiguration: IEntityTypeConfiguration<User>
{
public void Configure(...
-2
votes
2
answers
75
views
Apply string. join on Dictionary<string, List<int>> [closed]
I have situation where i have a dictionary of type Dictionary<string, List<int>> . I would like to apply sting.Join to it, I would like to have data displayed like:
"abc1:1,2,3,4,abc2:...
0
votes
0
answers
125
views
Auth0 Failed With Status 400
I am trying to create users from ASP.NET Core 5 Web API project for Auth0, was going through this official doc to make it work - Create User. Everything looks good through I am continuously getting ...
0
votes
0
answers
110
views
Why is the http.route Tag Missing in Jaeger Traces with OpenTelemetry on .NET 5 but Present on .NET 6?
I am using OpenTelemetry Version=1.8.1 and OpenTelemetry.Exporter.Jaeger Version=1.5.1 with .NET 5. When writing traces to Jaeger, the http.route tag is missing. I have another API based on .NET 6, ...
1
vote
1
answer
281
views
.Net Core Razor page POST requests give 400 Bad Request
I have a web application, and web API projects built in .net 5. I upgraded both of them to .NET 8.0 and updated all the packages in the project.
After upgrading to .NET 8 in the web application any ...
1
vote
0
answers
77
views
ASP.NET Core 5 Identity reset password token is randomly invalid
Using IdentityServer4 + ASP.NET Core Identity with .NET 5.
Our password reset endpoint throws errors, however, if I re-send the request a few times (the exact same request), it works again.
Here's a ...
0
votes
1
answer
1k
views
While building the Azure pipeline getting an error like .NET 5 has some compatibility issues with older Nuget versions(<=5.7), usedotnetcli/restore
While building the azure pipelines with classic editor i am getting the below error in build
.NET 5 has some compatibility issues with older Nuget versions(<=5.7), so if you are using an older ...
0
votes
0
answers
408
views
.NET 8 unable to send response with "application/octet-stream" header
The situation is. This endpoint needs to return the bytes of the file saved on the DB.
[HttpGet("/GetTemplate")]
[Produces("application/octet-stream")]
public HttpResponseMessage ...
0
votes
1
answer
270
views
VsCode The framework 'Microsoft.AspNetCore.App', version '6.0.0' (x64) was not found
I created a new net5 project using this command dotnet new webapi -n UserService --framework net5.0 I can run the app with dotnet run. But I cant debug it in VsCode. I get the error below. In my ....
1
vote
1
answer
145
views
How to config webhook in console application?
I have console application (in .net 5) that runs as window service with a lots of class libraries in the same solution:
Commons.cs proj (Class library)
BusinnesLogic.csproj (Class library).
and more......
0
votes
1
answer
38
views
How do I bind data automatically in controller action in .NET 5?
I'm very inexperienced with .NET so please bear with me.
I try to send a post request:
var postData = new FormUrlEncodedContent(new Dictionary<string, string>
{
{ "YearValue&...
1
vote
1
answer
282
views
Read email with attachments and convert to .eml file using Microsoft Graph API in C#
Need sample code to Read email with attachments and convert to .eml file using Microsoft Graph API in C#
Microsoft Graph API - 5.49.0 Version
Target Framework - Net 5.0
And please confirm whether am I ...
-1
votes
1
answer
55
views
Package-References to Roslyn not working when calling from native App
I have a problem generating C# code dynamically when the calling process is a native Win32 C++ application.
To narrow down the problem, I have created the following test projects:
DynCodeDll: .net5 ...
1
vote
1
answer
135
views
Roslyn and .net5
I try to use the Roslyn-compiler to compile some sourcecode at runtime. To do so I did
public static void compile()
{
SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(code);
}
Of course this ...
1
vote
1
answer
399
views
Debugging embedded Python code in .Net app using Pythonnet and Pdb
I have a worker service in which I need to debug Python code. To execute Python code I need to use Pythonnet. Pdb module is used for debugging.
I'm trying something like that:
python.txt:
import pdb
...
0
votes
0
answers
170
views
Logger Not writing logs to the Log Files in .NET 5 Web API when deployed on IIS locally
I want to deploy a .NET 5 Web API project to my local IIS. The project includes a Logger.cs file, which writes exception messages caught in controller methods to a text file located in the root of the ...
0
votes
2
answers
102
views
How to Enable Runtime Code Changes and Move Execution Pointer in Blazor WASM Client-Side Debugging with Mono/C#?
I'm currently working on a Blazor WebAssembly (WASM) .NET5 application and facing a challenge with client-side debugging: I'm looking to enable runtime code changes and move the execution pointer, ...
0
votes
1
answer
91
views
Why won't .NET 5.0 website won't run from IIS?
I've a .NET 5.0 website that runs in the QA environment without error. I copy the same files to production, and when I try to hit the website in a browser I get:
HTTP Error 502.5 - ANCM Out-Of-Process ...
0
votes
1
answer
217
views
Invalid token error on reset password email in ASP.NET Core 5 Identity
I am getting invalid token error while I am trying to reset my password by clicking reset password link via email.
I have been looking what problem would be and seen so many solution such as encode &...
0
votes
1
answer
1k
views
Is it safe to remove .NET 5 runtime if .NET 6 runtime is installed?
From a purely user perspective, I am not developing applications on Windows, I merely install and uninstall stuff.
Microsoft Defender tells me that the installed .NET 5 installation is end of service. ...
1
vote
1
answer
1k
views
System.TypeInitializationException - The type initializer for '<Module>' threw an exception
I have been working on an application for about two and a half years now and last month we went live and published our .NET application. The application is a WPF application that uses .NET version 5.0....
0
votes
1
answer
824
views
.NET 5 Unable to unprotect the message.State when trying the sign-in callback
We are running an Azure app service (linux) which is used for authentication and authorization. It is using Microsoft Identity to use Azure AD authentication, so we are using Azure ad oidc. Couple of ...
0
votes
0
answers
112
views
Basic authentication ssl and NTLM NET 5 API
How can I use basic authentication with ssl and NTLM at the same time in a NET 5 API?
The background of the question is the following: we are using a web UI which authenticates with NTLM (this should ...
-1
votes
1
answer
73
views
Post request .Net 5.0
I’m trying to write a Post request in the custom function. In php can be written using CURL, What about dotnet? What’s the best way to convert the below code to .Net?
$header = array(
'...
2
votes
1
answer
1k
views
.net5 => Could not load file or assembly System.Runtime, Version=6.0.0.0
I have a solution with several WebAPI projects. All projects worked as needed, nothing changed in code. But one Monday (yesterday) I turned on my computer and tried to debug one of the project, which ...
0
votes
1
answer
67
views
can't use Swashbuckle.AspNetCore.Swagger library
when trying to implement the Swashbuckle.AspNetCore.Swagger library, gets an error Error CS0246 The type or namespace name 'Operation' could not be found (are you missing a using directive or an ...
0
votes
1
answer
97
views
.NET 5 core api with Angular front end cors issues
So I have everything set up with an oracle db. The API runs fine and my angular app is able to send get requests to it just fine, but my post requests don't seem to work. I have some custom ...
0
votes
3
answers
572
views
Blazor Input Date does not revalidate upon value assignment
I have an InputDate from Blazor which should revert to the previous date if the change confirmation is not accepted which works. However, when I input something like 11/31/2024 which is an invalid ...
0
votes
1
answer
271
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 ...
1
vote
1
answer
71
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 ...
1
vote
1
answer
953
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 --...
-2
votes
1
answer
210
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 = ...
0
votes
1
answer
862
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 ...
0
votes
1
answer
1k
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 ...
1
vote
0
answers
144
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 ...
1
vote
0
answers
3k
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 ...
0
votes
0
answers
148
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 ...
0
votes
2
answers
123
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 ...
2
votes
1
answer
554
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 ...
0
votes
0
answers
119
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 ...
1
vote
0
answers
558
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 ...
3
votes
2
answers
4k
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 ...
0
votes
1
answer
503
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 ...
0
votes
0
answers
124
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 ...
1
vote
0
answers
60
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 ...
2
votes
1
answer
6k
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 ...
0
votes
1
answer
1k
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:
// ...
0
votes
1
answer
123
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 ...
0
votes
1
answer
6k
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....