340,756 questions
1
vote
1
answer
81
views
Playing audio independently of audio volume
How to play audio independently of system master volume? For example if my app has its volume set to 40, then the user increases their volume to 45 (assuming both mixers were starting at 40), the ...
1
vote
1
answer
96
views
How to run PowerShell script as admin with policy and scope
I am very bad and beginner with the PowerShell. What I need is to with the request that I receive run a powershell script. My request and response that I need looks like this:
public class MyRequest
{
...
0
votes
0
answers
62
views
Testcontainers.CosmosDb takes a long time to be ready
I'm working on an Integration test, where I want to use Testcontainers.CosmosDb, however it takes quite a long time (about 2min) for the CosmosDb to be ready.
var network = new NetworkBuilder()
...
1
vote
1
answer
92
views
How to upload files from a C# console app to Sharepoint?
I'm pretty new to this (4 months into my first dev job) and I'm stuck on something.
The company asked me to write a C# program that uploads files from my computer to SharePoint Online. I googled ...
0
votes
0
answers
54
views
How does NuGet choose package assets for x86 vs x64 project targets — will it download/reference a 32-bit package when the project is set to x86?
I'm trying to understand how NuGet selects and references package assets when a project targets a specific CPU architecture (x86 vs x64). My specific questions are:
If my project platform target is ...
1
vote
0
answers
152
views
Text DPI scaling difference between .NET Framework 4.7.2 and .NET 9
There seems to be a subtle difference in appearance between .NET Framework 4.7.2 and .NET 9 when scaling text with the DPI.
I made a small DPI-aware test project which compiles to .NET Framework 4.7.2 ...
5
votes
3
answers
147
views
.NET IHttpClientFactory + Microsoft Resilience retry: same HttpRequestMessage resent, delegating handler not re-running?
I have an HttpClient built with IHttpClientFactory and Microsoft.Extensions.Http.Resilience retry on 401. Pipeline:
Primary: HttpClientHandler (AllowAutoRedirect = false)
Delegating: ....
1
vote
1
answer
69
views
EPSON LQ-350 - Control Continuous Printing via C# code to print line by line and prevent form feed
Use case: to dequeue plain string messages and print them line by line on to tractor feed paper without a form feed happening after each message is printed. Current solution (in code below) prints one ...
0
votes
0
answers
58
views
Handlebars.net Pre-Compilation
We are a little confused about pre-compiling a template.
for example:
Is it possible to store the template variable in say a database and then just retrieve it and call
string source =
@"<div ...
3
votes
1
answer
167
views
how would I skew a Windows Forms texture/image so that one side is smaller/bigger than the other side to have a "pinched" look to it
(I am aware using windows forms for this kind of project is stupid and inefficient but it is a requirement for the college course I'm doing so I'm stuck using this)
in windows forms you can draw an ...
1
vote
0
answers
134
views
Send array of objects to .NET controller action
I am trying to pass a javascript array of objects to a .NET controller action List<> parameter. Below is my C#
public bool ImportACE([FromBody] List<Element> elements)
{
foreach(...
1
vote
0
answers
161
views
Strange hanging request in a .NET / Core application
I have two applications running, a web app on .NET 4.7.2 (versioning is not under my control...), and another on .NET 9 (LLM proxy service). The proxy service takes a request, routes it and uses ...
1
vote
0
answers
83
views
PowerShell hosting in C#: implicit remoting
I want to use the PowerShell 7 cmdlet Get-ClusterResource in C# under Windows 11, like this:
using System.Collections.ObjectModel;
using System.Management.Automation;
namespace PSHosting;
class ...
1
vote
1
answer
51
views
Unable to create MSBuild API's Project object when custom SDK needs to be downloaded from nuget.org
I have an SDK style project using MSBuild.SDK.SystemWeb/4.0.104 SDK. It builds fine, all works OK.
Now I have a tool which wants to analyze the project by first creating the Microsoft.Build.Evaluation....
0
votes
2
answers
64
views
.NET 4.6 to 4.8 update - package and updated file location under references
I am trying to update a legacy ASP.NET 4.6 app to .NET 4.8. The app contains 2 class library projects as well.
I'm now using VS2022 for the updating instead of VS2017/2019 that I was using before.
For ...
0
votes
0
answers
44
views
Problem with populating Fast Report via .NET code
I am trying to populate my fast report with dummy data using .NET code
DataTable dt = new DataTable();
dt.Columns.Add("name", typeof(string));
dt.Columns.Add("days", typeof(string))...
1
vote
1
answer
100
views
Calculate specific app's memory usage on C# [duplicate]
I’m trying to measure the RAM usage of a specific application using C# (.NET Framework 4.6.2).
I’ve already done some research and managed to get a result using Process.WorkingSet64,
but the value ...
2
votes
1
answer
113
views
MongoDB C# Driver: Update only provided fields, including setting some fields to null
I am using MongoDB with C# (MongoDB.Driver) and I want to update only the fields provided in my API model. My current approach works for updating values, but I cannot set a field (string, number, or ...
0
votes
1
answer
130
views
APS Design Automation: PackageContents.xml not being read from AppBundle in AutoCAD+25_1
I'm experiencing an issue with APS Design Automation (formerly Forge) where my AppBundle's PackageContents.xml is not being read/processed by AutoCAD Core Console, preventing my custom .NET DLL from ...
1
vote
0
answers
29
views
"error NU1301: Unable to load the service index for source" with private nuget feed
I've got a build pipeline in TeamCity and a private nuget feed hosted in aws codeartifact.
The first step in the pipeline calls aws codeartifact login with the appropriate parameters.
It works when I ...
0
votes
0
answers
71
views
How to return data annotations error message in one string?
I'm using data annotations from System.ComponentModel.DataAnnotations in my ASP.NET project. I get an error message where you can describe the requirements such as "Name is required" and etc....
0
votes
0
answers
69
views
ASP.NET Core SSE works locally but not on Azure App Service (events not flushing)
I have a simple ASP.NET Core API that streams events using Server-Sent Events (SSE).
Locally (Kestrel) it works fine: every WriteAsync + FlushAsync sends data to the client immediately.The endpoint ...
2
votes
1
answer
236
views
Correct way to handle appsettings.json on console app
I have a C# console app that is pushed to Azure DevOps and then deployed to a specific server. The app uses an appsettings.json file like this:
IConfiguration _configuration = new ConfigurationBuilder(...
1
vote
2
answers
117
views
How to fake a second function call using FakeItEasy?
I have a class that looks like this:
public int DoWork(int value)
{
return value + GetDataFromDB();
}
public int GetDataFromDB()
{
return 10;
}
In the real world the second function goes ...
0
votes
0
answers
52
views
Moq.Of<T> setup for Action<T> with a callback and capturing method parameter
Lets say we have the following interface:
public interface IGetRandomString
{
void Init();
bool IsInited { get; }
//returns random string of length chars
string GetRandomString(int ...