1,623,892 questions
0
votes
0
answers
15
views
problem in updating products while preloading them and cant
this is gonna be a long one so if you help me i would really appreciate it.
i have a page where both create and update product is.
my create page works find but i want this page to do update too so ...
-1
votes
0
answers
18
views
Having issues launching Visual Studio 2019 and creating standalone .EXE in Visual Studio 2022 like in Visual Studio 2019
My habits have been ruined lately since a windows update (it seems) corrupted a file in .Net Framework, named clr.dll, preventing Visual Studio 2019 from launching (and not only that software). It ...
0
votes
0
answers
14
views
Nea 2d game on unity need help to present interactable sprites and make words appear when typing
In my previous post, I didn't add many details and wasn't able to get effective help, so here I go again.
I am currently creating a 2d game inspired by both papers please and not my neighbour at the ...
-7
votes
1
answer
49
views
How to use a backgroundworker to encode ( base64 ) about 200 pdf invoices and write to sql db [closed]
How to use a backgroundworker to encode ( base64 ) about 200 pdf invoices and write to sql db. Now i use a sleep 15 sec between every encoding because pdf sizes varie
code to writ to sql db and ...
0
votes
0
answers
20
views
Pass item group elements to custom task array parameter in msbuild
I have a custom task written in C#. This custom task has an argument defined like this:
public required string[] StringArray { get; set; }
Then in a .csproj file I have these definitions:
<...
1
vote
1
answer
38
views
IHost does not release log file after Dispose()
I'm trying to read a log file that was written from a custom ILoggerProvider in a dotnet application:
HostApplicationBuilder builder = Host.CreateApplicationBuilder();
builder.Logging.ClearProviders();...
0
votes
0
answers
23
views
WPF Modal Window renders completely white (blank) in Hybrid WinForms application under load
I am maintaining a legacy hybrid application (Main App is WinForms, hosting WPF UserControls via ElementHost).
The Problem:
When opening a WPF Modal Window (Window.ShowDialog()) from the WinForms main ...
-1
votes
1
answer
41
views
What caused an unexpected build error in C# with Visual Studio
I have a C# program, and I am using Microsoft Visual Studio. I have been able to build and run the program without any issue for a long time. Now, unexpectedly I get this error:
I:\source\megaSearch\...
0
votes
0
answers
39
views
xUnit Testing in Testing Explorer
I'm trying to add tests to my MAUI app.
I added the xUnit test project to a separate namespace. The tests only run in the terminal with the dotnet test command.
If I use the test explorer, it doesn't ...
1
vote
2
answers
88
views
How to call Postgres function from .NET?
I tried this code:
CREATE OR REPLACE FUNCTION public.t4(in iid int, OUT n1 text, OUT n2 text)
LANGUAGE plpgsql
AS $function$
BEGIN
SELECT DISTINCT n1=l.name, n2=l.comment from ...
0
votes
1
answer
73
views
Performance and thread‑safety ASP.NET Core MVC [closed]
I’ve been working as a .NET C# developer for a little over two years in a software company. For almost a year now, I’ve been leading (as team leader/PM) a project that actually started before I joined....
-4
votes
0
answers
64
views
How can I sort a dictionary by its values? [duplicate]
How can I sort a dictionary that has string as its key and an int as its value by its values?
I want to have a dictionary that counts how many times a word appears in a string, and I want to have the ...
Best practices
0
votes
4
replies
92
views
Disposing FileStream in .NET
I need to process a list of FileStream objects with the DoSomethingWithFileStreams method like below. If I write code like this, I am concerned that the list of FileStream gets disposed before they ...
1
vote
0
answers
49
views
How to async fill the navigation property used for filtering when paging?
Learning EF Core, I am changing my mind on how to get the list of products with additional information (here symbolic code) -- see the loosely related (abandoned approach) at How to conditionally ...
Advice
1
vote
3
replies
64
views
Which design pattern should be used for the backend of a web application?
Description: I am building a web app, let's say about an organization for approving participation in a free service. There will be the following roles:
Organization employee
Citizen
Administrator
...
0
votes
0
answers
37
views
Users receive duplicate emails when sending to multiple google groups
I have a C# application that sends emails using System.Net.Mail.SmtpClient. I send emails to multiple Google Group distribution lists. Some users belong to more than one group, so they end up ...
-2
votes
1
answer
63
views
Should I reorder triangle vertices depending on their position to ensure correct winding (CW/CCW)?
I draw triangles in OpenGL using DrawArrays():
public void DrawTriangle(
Vector2 a,
Vector2 b,
Vector2 c,
ShapeOptions shapeOptions = null)
{
shapeOptions ??= PresentationConsts.Shape....
0
votes
1
answer
48
views
Could not load file or assembly 'MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified
I have a main project of type console, and it references other library-type projects in the application. When I build the solution, it compiles normally, but when I run it in debug mode, it tries to ...
-1
votes
2
answers
100
views
ArgumentException when calling MethodInfo.MakeGenericMethod
public void Test<T>(T reference, T same, T differentOrGreater)
{
var comparisonInterface = typeof(T)
.GetInterfaces()
.FirstOrDefault(
i => i.IsGenericType &...
0
votes
1
answer
78
views
Component is not rendering after StateHasChanged call
Coming from a WPF background where you normally just bind to a property which updates the view, I want to update the information in a component when I have new data.
So I have a item view that is ...
1
vote
0
answers
46
views
Error when mapping a list of enums in EF Core to PostgeSQL array
I have a class with a collection of enums mapped into PostgreSQL native enum:
internal class EventStackFilter
{
// other properties omitted
public List<EventStackEventStatus> Statuses { ...
0
votes
0
answers
60
views
How to send HTTP POST request with multipart/form-data with the form-data in initial request in .NET Framework?
I have to upload a file to an embedded device running an API.
First, I tried to write methods to do this in a test project. This works great:
private static async Task<HttpResponseMessage?> ...
-3
votes
0
answers
104
views
Adjusting Control Width and Height programmatically [closed]
I am using Microsoft Visual Studio Professional 2022. I'm creating forms programmatically adding content based on a JSON configuration, I need to set the size of the controls according to the ...
0
votes
1
answer
50
views
How can I get Liquid Data Mapper to target .NET 8 and not .NET Framework 4.6.2?
When I generate a data mapper library using Liquid Data Mapper, it always binds to .NET Framework 4.6.2, but I need it to target .NET 8.
How can I change this functionality?
My source is a CSV file ...
3
votes
0
answers
131
views
.NET 10 benchmark oddities (comparing to .NET 9)
I run the following benchmark just to evaluate new .NET 10:
[SimpleJob(RuntimeMoniker.Net90)]
[SimpleJob(RuntimeMoniker.Net10_0)]
[MemoryDiagnoser]
[HardwareCounters(BenchmarkDotNet.Diagnosers....
-1
votes
1
answer
56
views
Publish Failed, but able to build successfully, and run
My project is able to build and run, but when I want to publish the project, I get this :
Warning As Error: Detected package downgrade: System.Net.NameResolution from 4.3.0 to 4.0.0. Reference the ...
0
votes
0
answers
44
views
.NET Framework SDK project: Launch arguments duplicated for x64 platform
I'm working on a C# .NET Framework 4.8 SDK-style project (WPF, Sdk=Microsoft.NET.Sdk).
I want to pass command-line arguments to my project when running from Visual Studio. I created a launchSettings....
-6
votes
1
answer
98
views
Wrapping a method in a try-catch block but unsure where to declare a char variable
I have this method in my program, it is meant to register the gender of the user for later on in the program (with Male and Female as the only valid options):
public static void Main(string[] args)
{
...
0
votes
1
answer
43
views
DevExpress ASPxGridView reloads data on every group row expand - how to cache/prevent?
My DevExpress ASPxGridView reloads the entire dataset every time I expand a grouped row, causing performance issues. The LoadGeneralSearch() method fires on each expand, re-executing the SQL query.
...
Advice
0
votes
2
replies
52
views
How do I parse an object with a Dictionary from a yaml file?
Here's the general structure:
public struct Choice
{
public string result;
public string nextBranch;
}
public struct Branch
{
public Dictionary<string, Choice> choices;
}
public ...
3
votes
1
answer
105
views
Initializing a property in a method called from the constructor
This doesn't compile:
public class MyClass
{
private string Name { get; init; }
public MyClass()
{
MyMethod();
}
public void MyMethod()
{
Name = "Hello&...
0
votes
1
answer
34
views
Weird blurring / gradient mask effect in safe area on dotnet MAUI maccatalyst
I'm building a dotnet maui application. One of the targets that I am using is Mac OS X maccatalyst. My app consists of a hybrid web control that goes into the safe area with negative top margin so ...
1
vote
0
answers
35
views
Microsoft.ML C#: GPU not found in K8s/Docker container
I have created a .NET app that uses Microsoft.ML.OnnxRuntime.Gpu for interference. Now I'm trying to integrate it with Azure Kubernetes.
We have made the setup with Tesla T4 GPU and we confirmed it's ...
0
votes
0
answers
74
views
.NET Framework 4.7 app fails to load dependency from .NET Standard library due to NuGet selecting different assemblies
I have a solution with two projects:
A class library targeting .NET Standard 2.0
An application targeting .NET Framework 4.7
The .NET Standard library references a NuGet package that ships different ...
0
votes
0
answers
39
views
NLog.Web.AspNetCore not formatting object as JSON
I'm trying to log error objects as JSON in my ASP.NET Core 9 Web API. I am following the wiki in the NLog documentation: Structured logging.
I have NLog.Web.AspNetCore v6.0.5 as a dependency. In ...
1
vote
1
answer
101
views
Get all implementations of an interface for a class, including for base
public interface A<out T>
{
public T Property { get; }
}
public class BaseClass : A<string>, A<int>
{
string A<string>.Property => "BaseClass";
int A&...
0
votes
0
answers
58
views
My MCP Server is not discovering my custom tools
I have a stdio mcp server running locally. The mcp server builds and runs. I have created 3 basic mcp tools that I will use for context when I prompt in Copilot however my tools are just not ...
-3
votes
0
answers
51
views
Can't implement .NET Blazor identity [closed]
When I try to create a scaffolded item for my identity, I get this error:
This is what I did to create my Blazor identity:
Currently, my Data folder only has a file called FoundBoxContext.cs:
Does ...
0
votes
0
answers
37
views
HangFire ASP.NET Core 8 MVC the UseMySqlStorage is not working?
I am trying to install and configure the HangFire to make background service in an ASP.NET Core 8 MVC app. I have been installing all packages but when I try to make the configurations it throwns an ...
0
votes
0
answers
43
views
MSTest not properly discovering DataTestMethods when adding new folder to project
When attempting to add additional folders to my MSTest project and creating test class files within them that have tests that use the DataTestMethod tag with DataRow. Test explorer improperly ...
1
vote
1
answer
41
views
Velopack is not updating version of WPF application
My WPF app is Windows only.
I cleared my */Releases folder and build my project:
dotnet publish --self-contained -r win-x64 -o .\publish
Then I created a release:
vpk pack --packId MyApp --...
0
votes
1
answer
42
views
Is it possible to log ApplicationBuilder configuration failure?
I'm using NLog with ApplicationBuilder. The problem is that application startup failure is not captured with NLog. Is there something I can do with it, or should I report this to MS?
Here is the ...
1
vote
1
answer
97
views
How to auto login in Swagger API in development mode?
I want to not get token from login endpoint in Swagger every time I run and debug the API code. I have added this code to the program.cs file to get authenticated, but when I test an endpoint with an [...
1
vote
0
answers
53
views
Azure Function with RabbitMQ Trigger - Queue not found in localhost
For local development I want to connect my Azure Function to a locally running RabbitMQ instance and run everything locally. But the queue is not found, even though I made sure it exists (see ...
0
votes
1
answer
48
views
While generating PDF using puppeteer sharp, the content under canvas tag for map is not displaying, instead displaying empty [closed]
I tried using Puppeteer Sharp in headless mode to generate a PDF for a dashboard that contains a map, which uses a <canvas> tag for its content. In the generated PDF, the heading is displayed ...
Advice
0
votes
0
replies
31
views
How to build complex queries with Contentstack Management C# SDK v0.5.0 without using JObject or raw JSON strings
I'm using Contentstack.Management.CSharp v0.5.0 and need to fetch entries with a complex query involving nested $and and $or conditions.
My Query:
{
"$and": [
{"is_enable": ...
1
vote
2
answers
84
views
Unity gameobject destroyed and returns "null" but still returns "obj == null" as false
I have a class for lists called UniqueListWithActions<T> with the constructor method
public UniqueListWithActions(List<T> _list)
{
list = _list;
}
list is declared as
...
1
vote
0
answers
52
views
How to log Headers or Cookies added to outgoing http-request by SocketsHttpHandler
I have a typed HttpClient, added to DI like this:
builder.Services
.AddHttpClient<IExternalApiClient, ExternalApiClient>()
.ConfigurePrimaryHttpMessageHandler(() => ...
-1
votes
0
answers
48
views
Sending emails with MailKit stopped working on some servers [closed]
I've got a C# Windows service that sends out an email using MailKit when the service is started (or if there's been an error). This has been working flawlessly for years. At some point on 23/11, it ...
0
votes
0
answers
72
views
C# extended control not appearing in Toolbox
I'm new to C# and I'm currently trying to extend a control. The project compiles fine, but unlike every other tutorial/resource I've seen, the extended control does not show up in the toolbox.
This is ...