Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
0 answers
7 views

C# .Net Core Compile only one appsettings.json [duplicate]

In my application often I have three files of settings: appsettings.json appsettings.Development.json appsettings.Production.json When I publish, all three files are brought into the publish folder. ...
erikscandola's user avatar
  • 2,916
0 votes
0 answers
8 views

How to show debug logs while running blazor hybrid app on local android device?

I am using VS2022 Community Edition on Windows 10. I have followed this tutorial https://learn.microsoft.com/en-us/dotnet/maui/android/device/setup?view=net-maui-8.0 and have gotten my blazor hybrid ...
AgentX4000's user avatar
0 votes
0 answers
19 views

Differences between dotnet build -r and dotnet publish -r

With the following project file: <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net8.0-windows</TargetFramework> </PropertyGroup>...
fharreau's user avatar
  • 2,265
0 votes
0 answers
19 views

How to securely store and retrieve sensitive data in a .NET Standard 2.0 cross-platform (Windows+Linux) library

I have .NET Framework 4.7.2 library to store and retrieve sensitive data (like tokens for our desktop apps communication) with help of CredentialManagement package on Windows. Now I need to make this ...
bairog's user avatar
  • 3,271
1 vote
1 answer
22 views

Why do I have to specify the runtime identifier in the csproj for a publish?

I am doing the following to build my application: dotnet build MyApp.sln -c Release dotnet test MyApp.sln --no-build -c Release dotnet publish MyApp.csproj --no-build -c Release -r win-x64 The aim ...
fharreau's user avatar
  • 2,265
0 votes
1 answer
38 views

Problem installing .NET SDK in Visual Studio Code

I'm trying to use C# in VS Code which requires me to install the .NET SDK. I'm following the steps provided by VS Code to install it, but it doesn't work, even after reinstalling it does not work. ...
Ahmad Adief's user avatar
0 votes
0 answers
24 views

Preventing SSRF when sending Webhooks via HttpClient

I want a server application to send webhooks (i.e. outgoing http-post requests) to user-controlled http(s) URLs. A naive implementation of that functionality is vulnerable to server-side request ...
CodesInChaos's user avatar
0 votes
0 answers
32 views

Cannot load appsettings.json after converting .NET Core 3.1 console application to .NET Core 3.1 WinForms application

There was a console .NET Core 3.1 application for SOAP communication based on IHost / IHostBuilder. New requirements came and I had to convert the application to the GUI application. I chose WinForms. ...
Paul's user avatar
  • 26.3k
0 votes
1 answer
33 views

.NET 8 Windows Service Example won't start (System.IO.IOException)

I'm trying to create a .NET 8 Windows Service. Have followed this guide: https://learn.microsoft.com/en-us/dotnet/core/extensions/windows-service All is good until I try to start it, Event Viewer ...
mhapps's user avatar
  • 1,063
2 votes
1 answer
131 views

Why is C# DateTime.Now/DateTime.UtcNow ahead of SQL Server's SYSUTCDATETIME()/SYSDATETIME() even though C# code executes before the SQL Query

I want to know the reason why my C# date is larger than the SQL date even though the C# code is running first and after that the SQL query, Logically the SQL date should be greater than C# date. For ...
Shivam's user avatar
  • 29
0 votes
0 answers
26 views

Any pitfalls in upgrading a WPF application from .Net 6 to .Net 8?

We're looking to upgrade some large WPF solutions from .Net 6 to 8, and my understanding is that the process should be straightforward (changing the projects' target framework). But are there any ...
Andrew Stephens's user avatar
0 votes
0 answers
12 views

IRequestExceptionHandler fails to be properly resolved while response type is generic

Inspired by https://code-maze.com/csharp-global-exception-handling-for-mediatr-requests/ Using MediatR is it possible to create a generic RequestExceptionHandler for any and all requests? I was trying ...
user2184057's user avatar
0 votes
0 answers
12 views

Blazor WebAssembly in Docker: Client Shows 'This page isn’t working right now' Error

I have a project with two parts: a server using ASP.NET Core Web API and a client using Blazor WebAssembly (PWA). I'm trying to containerize both parts using Docker. While the build and run processes ...
Keshish's user avatar
  • 13
0 votes
1 answer
41 views

Replace existing action routes in ASP.NET Core

I have my ASP.NET Core 8 project that references to external project that contains the following controller: public class AccountController { [HttpGet] [AllowAnonymous] public async Task&...
DotCat1985's user avatar
1 vote
0 answers
37 views

ArgumentOutOfRangeException error while assigning OracleClob value to .NET Core string

I want to read large clob data type (2 million rows in table) from a stored procedure in an Oracle database. After reading the data and trying to assign OracleClob value field to .NET Core string type,...
Onur's user avatar
  • 23

15 30 50 per page
1
2 3 4 5
1696