Questions tagged [.net]
Do NOT use for questions about .NET Core - use [.net-core] instead. The .NET framework is a software framework designed mainly for the Microsoft Windows operating system. It includes an implementation of the Base Class Library, Common Language Runtime (commonly referred to as CLR), Common Type System (commonly referred to as CTS) and Dynamic Language Runtime. It supports many programming languages, including C#, VB.NET, F# and C++/CLI.
339,451
questions
0
votes
0
answers
7
views
Generic way of handling call to multiple api endpoints that use JWT
Setting up an application to call one of a handful of different client api endpoints, each of which use JWT. However, as of now I dont know the specifics of how the specific client might implement ...
0
votes
0
answers
9
views
I created a c# Roslyn source generator and a test, the generator works but the test doesn't find the same source
I created a simple source generator that works fine
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
...
0
votes
0
answers
21
views
Access denied trying to execute c# console application
First up, I'll admit I'm a total noob at this. I'm just trying to learn, but it gets hard when I hit this kind of problem. Google hasn't provided any answers so I thought I'd ask here.
I built my ...
0
votes
0
answers
5
views
The top XML element 'ReservationControlInformationDetailsTypeI' from namespace '' references distinct types
I used svcutil to generate proxy class. I used this proxy class to communicate with Amadeus web services, But when compiling the web service, the error is generated and it is given below.
The top XML ...
0
votes
0
answers
14
views
Ghostscript Log Creation
I have an application where I am using ghostscript to convert image to pdf. I am using dll of ghostscript and using it in a .Net web api. And ghostscript software is also installed in the server, ...
-3
votes
0
answers
13
views
Convert a html data or string to XSLT and then to pdf or is there any other way to do in C# [closed]
Can someone help me to figure out how we can convert a html data or string to XSLT and then convert to pdf or is there any other way to do in C#.I need to map the values we have in html to pdf. Please ...
0
votes
0
answers
8
views
opentelemtry exports previous custom metrics every 10 sec
I have a .NET application configured to export custom metrics using the OpenTelemetry SDK to Application Insights. I’ve noticed that even when metrics aren’t updated, OpenTelemetry still pushes the ...
0
votes
0
answers
13
views
What is the Mapperly equivalent of AfterMap method in Automapper?
I'm trying to replace AutoMapper with Mapperly in our project due to the latter's performance. However, I'm facing difficulty while replacing AutoMapper with Mapperly because I can't find any ...
0
votes
0
answers
6
views
How can I resolve the error named "callElasticsearch" in APM?
Good morning,
I have all the observability of the company in ElasticSearch using APM and now appears an error named "callElasticSearch" with this message:
How can I manage that not appears ...
0
votes
0
answers
13
views
Validation gets lost on tab change
I am using a tab control to group different input fields like text boxes. I am validating the user input of those text boxes via IDataErrorInfo in my view model.
Now, when the user input is not valid ...
0
votes
1
answer
10
views
.ASPXAUTH cookie not being read by sub application
I have an asp.net v4.7.2 web app setup at, my.example.com in IIS. It uses asp.net Forms Authentication. It's Web.Config:
<httpCookies requireSSL="true" />
<authentication mode=&...
0
votes
0
answers
6
views
Github Action Docker Build Segmentation fault for ARM64/v8
I am trying to build a docker image and publish it to Github Container Registery that can be started on my Raspberry Pi with Ubuntu 22.04, ARM64/v8.
Build for amd64 forks perfectly, but whenever i ...
-2
votes
0
answers
16
views
i have this error The page cannot be displayed because an internal server error has occurred [closed]
When I uploaded the site to the host, there was no problem. But when we are working with the site. For example, we return to the main page or perform a delete operation, this error occurs!
I ...
1
vote
1
answer
23
views
How to check for updates in my C# app published on MS Store
I am a Mac developer who has just started building Windows apps. My app will be published to the Windows Store.
Do apps downloaded from the Windows Store have to check for new versions themselves, or ...
0
votes
0
answers
21
views
Orleans IPersistentState POCO Namespace Versioning problems
I'm using <PackageReference Include="Microsoft.Orleans.Sdk" Version="8.2.0" /> To generate a serializer for a pretty simple record:
namespace BaseNamespace.OldNameSpace;
[...
0
votes
0
answers
26
views
Strategy for handling multiple EF Migrations
I need help formulating a strategy for handling situations where two or more team members create an EF migration independently and for different reasons. Every single time we've had this scenario so ...
0
votes
0
answers
19
views
Why am I receiveing this collation error in .NET Framework 4.5?
Currently I am analyzing old solutions in my company and it we get following error message randomly:
A .NET Framework error occurred during execution of user-defined routine or aggregate "...
-1
votes
1
answer
33
views
How does the `CalculateButton_Click` method validate and update `HourlyEmployee` and `CommissionEmployee` properties, and handle input errors? [closed]
I need to understand how the CalculateButton_Click method in my WPF application handles input validation and updates for HourlyEmployee and CommissionEmployee objects. Specifically, how does it check ...
0
votes
0
answers
36
views
How to completely hide the title bar in a .NET MAUI application on Windows while retaining resizability?
I am developing a .NET MAUI Blazor Hybrid App for Windows, and I want to hide the default title bar completely while keeping the window resizable. I've tried modifying the MauiProgram.cs file to ...
0
votes
0
answers
18
views
Sort results of DataView are different in different versions of .Net Framework
The GoodsNo column of the DataView has two pieces of data, HB3-T017 and HB-T015, which are now sorted by GoodsNo, with different results in .Net2.0 and 8.0.
The order under .Net2.0 is HB3-T017, HB-...
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.
...
0
votes
1
answer
23
views
How to embed Python to .Net?
I tried to embed Python to .Net using pythonnet based on the docs here and here.
Here are my code
Runtime.PythonDLL = @"D:\Dev\Console\.conda\python311.dll";
PythonEngine.Initialize();
...
0
votes
1
answer
40
views
Refactoring command pattern
I have implemented a command pattern for an SDK that I am building in C# but I want to prevent it from being misused. What I currently have (1) is this. Notice how the request's Execute method can be ...
0
votes
0
answers
25
views
.NET MAUI XAML Binding TemplateSelector ViewModel Command
I'm new to .NET MAUI and XAML so I apologize in advance for any written/conceived "heresies".
I have a "Detail" XAML ContentPage to which I have associated a specific viewModel as ...
0
votes
0
answers
7
views
How do I definitively close ODBC connections when Pooling=false appears broken
So, I haven't seen a thread that talks about this from this direction.
I'm trying to write some code to track the average amount of time it takes to open an odbc connection to a database.
I figured it'...
0
votes
1
answer
37
views
Why installation of dotnet-ef fails even if --ignore-failed-sources is specified
I'm building a .NET 6 project via Azure DevOps Pipelines. One of the step is to install the Entity Framework tools so a later step can generate a SQL migration script.
However, the installation step ...
0
votes
0
answers
12
views
Difference between using "dotnet pack" and "GeneratePackageOnBuild"?
I understand that using dotnet pack is intended for creating NuGet packages, and dotnet publish is intended for creating deployable DLLs/EXEs. However, using the GeneratePackageOnBuild property in the ...
0
votes
0
answers
26
views
Issues with File Upload in ASP.NET Core using Blazor
I'm working on a project with separate backend and frontend folders. On the frontend side, I have the following service for uploading files:
public async Task<IEnumerable<FileMetaDataDto>>...
0
votes
0
answers
15
views
Umbraco: An item with the same key has already been added. Key: title error
I upgraded my website to Umbraco 14 and when I try to add new items I the following error message:
An item with the same key has already been added. Key: title
Then I run the following command on the ...
1
vote
0
answers
9
views
How to integrate Clerk Authentication with ASP.NET Core 6.0 Web API (SQL Server as database)
Whenever a user is registered / updated in my frontend app (which uses REACT) by clerk authentication, I want to store this details in my database too. For example if a user is created with certain ...
0
votes
0
answers
24
views
Issue with Building .sqlproj Project on macOS Due to Missing SSDT References
I'm currently working on a .NET 6 project. It includes a .sqlproj file for database schema management.
Problem faced
When trying to build the project with the .sqlproj file on macOS, I get build ...
-1
votes
1
answer
34
views
Getting a timeout only in GitHub Actions when trying to use SQL Server with TestContainers
This is my first time trying to use TestContainer. I am using it to make sure the tests run on a fresh database. This works with Docker Desktop locally and runs quite fast. I am now testing to see how ...
-1
votes
0
answers
26
views
My WPF app is not displaying text correctly in some datagrids [closed]
This is the UI on a windows 10 machine
This is the UI on my IDE and other PCs
As you can see the text is missing and the context menu isn't openning
I tried reinstalling graphics drivers, updating ....
0
votes
1
answer
36
views
Unity. Inspector references to objects disappear after restarting the scene
The bug occurs in two cases:
When I restart the scene
When I go to another scene and then come back
The game works correctly only after the first start of the scene.
The essence of the bug is that ...
-1
votes
0
answers
36
views
In C# which library is faster to use read and write Excel or CSV? [closed]
I'm an intern, and right now I have an Excel sheet assignment.
I therefore need the data to be retrieved from an Excel sheet or CSV file. I now use the Microsoft.Office.Interop.Excel library, however ...
0
votes
1
answer
21
views
.NET MAUI Editor Control Keyboard Problem
The Editor control in .NET MAUI has no keyboard style with a "Done" button except for "Numeric" and "Telephone" styles. This is a problem. If a user taps in an Editor ...
0
votes
2
answers
40
views
Deserialize JSON objects do different class names
I am using System.Text.Json to deserialize objects from an external API call in C#. I have created the classes for the data and is very straight-forward.
public class DocumentListRoot
{
...
1
vote
1
answer
21
views
How to set a JsonSerializerOptions globally for my httpClient.GetFromJsonAsync<T> calls
In my ASP.NET web API I have httpClient which call GetFromJsonAsync:
var jsonSerializerOptions = new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true,
};
...
1
vote
1
answer
29
views
Mock Google's StorageClient ListObjects method using Moq
I'm trying to unit test the following method
public List<string> GetFilesInGCS(string bucket, string node)
{
List<string> fileNames = new List<string>();
try
{
...
0
votes
0
answers
14
views
Multi-Framework Targeting for NuGet Packages
Background - My Build Scripting
I would like to use the dotnet CLI to create a nuget package that can target the following frameworks: net462, net48, net8.0. My library has no dependencies (i.e. it ...
0
votes
1
answer
25
views
How does OpenIdConnectEvents get overrided?
below is the source code:
https://source.dot.net/#Microsoft.AspNetCore.Authentication.OpenIdConnect/OpenIdConnectHandler.cs,1288
where await Events.AuthorizationCodeReceived(context); must exchange ...
0
votes
1
answer
38
views
Microsoft.Data.SqlClient data layer equivalent [closed]
In Microsoft.Data.SqlClient which is the equivalent of System.Data.SqlClient data layer?
I'm rewriting an old procedure from a fired collaborator and now I have that problem...
It's a simple question ...
0
votes
1
answer
28
views
msbuild error: AssemblyRef does not contain a definition for 'Configuration'
I am 'migrating' a visual studio build to a batch script,
I have a one big project that has many dependencies,
i build my project with msbuild.exe using windows batch script,
the main project (client) ...
1
vote
1
answer
25
views
Convert one object to two different DTOs based on a condition
In one of our projects we are using .NET AutoMapper (version 10.1.1). In others, we realized using AutoMapper is too complex and moved to direct manually mapping which is way faster and way more ...
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 ...
0
votes
2
answers
45
views
Fetch documents/files from share point drive
We have multiple SharePoint sites, and our application is registered on the domain. Currently, we are trying to fetch documents from SharePoint using a client ID and secret, but we are encountering ...
0
votes
1
answer
47
views
Getting "System.IO.FileNotFoundException: Could not load file or assembly 'Azure.Core, Version=1.38.0.0" in Azure Function App
Currently, I am running a .NET 8 Azure Function app in Azure. It's a dotnet-isolated function running on a Linux App Service plan.
I am getting this error when trying to run the HTTP trigger function:
...
0
votes
0
answers
13
views
How to install prerequisite during installation
I have already created an installer for my application using the Microsoft Visual Studio 2022 Installer Project. The installer installs my application and automatically launches the setup for any ...
0
votes
0
answers
24
views
how to manage `_id` field mongodb c# driver
So I am in a bit of pickle
Suppose I have this Class which I use to save/retrieve records from MongoDb
public class Purchase
{
public ObjectId Id { get; set; }
public PurchaseDetails Purchase {...
0
votes
1
answer
56
views
dotnet restore and AzureDevops private feed in WSL
I need to run an Asp.Net Core application in WSL (Ubuntu 22.04), I'm trying to execute command:
dotnet restore
to restore my nuget packages from default nuget.org and from my private feed on Azure ...