Questions tagged [c#]
C# (pronounced "see sharp") is a high-level, statically typed, multi-paradigm programming language developed by Microsoft. C# code usually targets Microsoft's .NET ecosystem, which include .NET, .NET Framework, .NET MAUI, and Xamarin among others. Use this tag for questions about code written in C# or about C#'s formal specification.
101
questions
0
votes
0
answers
21
views
ASP.NET Core MVC: Comment Replies Not Working After Refactoring
I am working on an ASP.NET Core MVC project that involves posts and comments. Users can leave comments on posts, and they can also reply to other comments. The initial implementation was working (...
-2
votes
0
answers
47
views
How can we update decimal precision for two places in c#? [closed]
I have a model class with a decimal? amount column. This has value from database is 35.00 but when passing from API It has 35.0. I'm trying to update decimal precision by two digit. something like 35....
0
votes
0
answers
17
views
Multi-Collection Views - Display .NET MAUI CollectionView within a CollectionView
I am developing a c# .NET Maui application that creates a bowling app that maintains a recap of scores for bowling team. The requirements are that it is a general application that supports leagues ...
0
votes
0
answers
54
views
Passing an array of objects from C# to VBA Excel
I have a C# console application and Dll. I registered the dll as COM via interop. I used the
COM Visible property, GUID etc
Set Assembly Information, Build information to register it to COM
I ...
0
votes
0
answers
6
views
Converting Word Document to PDF with Winnovative - Form Fields
I have a word document, that I want to convert to PDF via Winnovative. The basics work, as done with the following function.
public byte[] ConvertWordToPdf(Stream fileStream)
{
var ...
0
votes
0
answers
17
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
23
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
10
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. ...
0
votes
0
answers
37
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 ...
-1
votes
1
answer
48
views
Get all keys in a dictionary [closed]
I have a collection of objects that contain a dictionary, and would like to extract only the keys and not the values in the dictionary (which are much larger than the keys, unlike in the example below)...
0
votes
0
answers
13
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 ...
0
votes
0
answers
21
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>...
0
votes
0
answers
13
views
Data resolution are not changing when try to minimize the resolution
In Firefox browser, when opened in normal form all data moves towards right, while it appears correctly in Chrome and Edge. Also when I tried to minimize the resolution in edge or chrome all data ...
0
votes
0
answers
12
views
.Net 8 Blazor Web App (server) -> Start with browser language and allow user to change language via dropdown
What I want to achieve
I want my Blazor Web App (server rendering) to start with translations that fit to the browser language but also offer a language selection to the user to change the app ...
0
votes
0
answers
25
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 ...