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.
1,620,397
questions
-2
votes
0
answers
65
views
C# How to send Email
I want to use my application to send e-mail.
I tried this:
try
{
MailMessage mail = new MailMessage();
mail.From = new MailAddress(form);
mail.To.Add(to);
mail.Subject = subject;
...
1
vote
1
answer
22
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
18
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
25
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 ...
-1
votes
1
answer
31
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
1
answer
22
views
How do I implement a scheduled task for file transfer with different start/end time and cleanup?
I find myself in somewhat of a slump with the program I am trying to create. I was given the task of automating a file transfer from one folder to another using C#. I have four source folders, let's ...
1
vote
0
answers
11
views
How do I open a new window on top of other windows using a NavigationViewItem?
Is this a bug in Visual Studio 2022, or am I missing something?
I don't know why only using a button opens the window on top like I want it to. Putting a button in the navigation view doesn't look ...
0
votes
0
answers
35
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
14
views
Office 365 Power Query framework for developing Excel Add-in [closed]
enter image description here
I want to build the similar framework to display the Data on selection of a cell either of the language. Please refer the attached image.
Can someone recommend me how can ...
0
votes
0
answers
17
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
35
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
0
answers
19
views
Ignoring rows that have Null in a cell. C# IronXL
I am working on a project where I want to make my program read an Excel sheet, and read out the information to a textbox, however I have been able to do this but I want it so if any cell in a row has ...
0
votes
0
answers
52
views
Is there anyway to read from a request body directly in an action without middleware?
I want to be able to read a request body in an action while still also using default MVC behavior, which involves posting with a [FromBody] parameter. As far as I know I need middleware to accomplish ...
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 ...