10,936 questions with C#-related tags

Sort by: Updated
0 answers

Inserting TextAnnotation in graph c#

I creating simple graph with line as average (sample only), I have a code in HorizontalLineAnnotation (color red line) and TextAnnotation but the problem is that, the TextAnnotation not working properly. Here my code in HorizontalLineAnnotation and…

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,131 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
asked 2024-10-12T10:42:00.2033333+00:00
YUI-012 60 Reputation points
1 answer

Code to split x³

I got help from the for to split exponents , but the below code won't split x³ I want output as x and 3 using System; using System.Text; using System.Text.RegularExpressions; string input = "2³"; Regex regex = new…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
asked 2024-10-11T17:35:16.54+00:00
Kalyan A 245 Reputation points
answered 2024-10-12T09:43:49.7+00:00
Kalyan A 245 Reputation points
0 answers

Are ESim related WinRT APIs require Package Identity?

Hi, team I am trying to use WinRT API (under name space Windows.Networking.NetworkOperators) to read ESim ID on my laptop. I created a UWP App and this api worked. However the project i'm working on is not a UWP app and it's based on .NET 4.6. I imported…

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,403 questions
Universal Windows Platform (UWP)
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,777 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
2,352 questions
asked 2024-10-11T06:40:18.12+00:00
Jayden Xia 0 Reputation points
edited a comment 2024-10-12T02:34:11.2066667+00:00
Jayden Xia 0 Reputation points
0 answers

Datagridview with datatable as a datasource - user edits

I have a winform project in visual studio. I have placed a datagridview on the from. I build a DataTable with data from a database. I then add a new column to the datatable and assign the datatable as the datasource for the datagridview. Run the…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
asked 2024-10-11T21:52:02.09+00:00
Darryl Hoar 181 Reputation points
1 answer

Can someone help me solve this problem in C#?

There is a number 1 written on the board. We have a sequence a of n natural numbers, and in the i-th step (1 ≤ i ≤ n), we erase the current number on the board and replace it with the product of that number and the number a[i]. After each step, determine…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
asked 2024-10-05T15:14:35.93+00:00
Uros Zeradjanin 0 Reputation points
commented 2024-10-11T20:47:29.15+00:00
Uros Zeradjanin 0 Reputation points
3 answers

Bubble sort implementation in c#

Here's how to implement a bubble sort in c#. Follow for more content like this :) int[] array = { 108, 23, 69, 420, 9 }; int temporary; for (int j = 0; j <= array.Length - 2; j++) { for (int i = 0; i <= array.Length - 2; i++) { if…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,861 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
asked 2023-04-26T17:46:47.1+00:00
Jack Herer 110 Reputation points
answered 2024-10-11T16:41:15.0366667+00:00
Bruce (SqlWork.com) 65,316 Reputation points
1 answer

How to generate balance seed using LINQ query

I have some data on the left side of the image below. I want to create a balance seed like the one on the right side using Screenshot (22).png

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
asked 2024-10-10T16:16:23.6533333+00:00
jewel 901 Reputation points
commented 2024-10-11T15:09:12.2833333+00:00
jewel 901 Reputation points
0 answers

How do I receive the download progress of a Microsoft Store package? | WinUI/UWP

Hi. I'm installing a package from the Microsoft Store from my WinUI application, but I'd like to see the download progress. I have the following code on Constructor: PackageCatalog packageCatalog => PackageCatalog.OpenForCurrentUser(); And when I…

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
784 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
asked 2024-10-03T14:36:32.7566667+00:00
Anderson Rodrigues Cavalcante 316 Reputation points
commented 2024-10-11T11:30:22.3766667+00:00
Anderson Rodrigues Cavalcante 316 Reputation points
1 answer One of the answers was accepted by the question author.

Can C# detect exponents like 2² , 2³ not the ones with carets(^)

Can C# detect exponents like 2² , 2³ not the ones with carets(^). I want to detect 2³ and write Base =2 Exponent=3 The below code is from Copilot , It cannot detect 2² using System; using System.Text.RegularExpressions; class Program { static…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
asked 2024-10-10T13:58:21.0633333+00:00
Kalyan A 245 Reputation points
accepted 2024-10-11T08:19:47.5533333+00:00
Kalyan A 245 Reputation points
1 answer One of the answers was accepted by the question author.

I can't change property of a button....

Hello, I wrote an app has 1 datepicker, 2 textblocks, 2 textboxes, and 2 buttons. My problem is one of the buttons remains unabled like below. xaml code for this view is: <Window x:Class="WpfApp3.MainWindow"        …

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,777 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
asked 2024-10-11T04:31:36+00:00
c00012 736 Reputation points
accepted 2024-10-11T07:44:56.9333333+00:00
c00012 736 Reputation points
3 answers

How to Configure Library Files to Run in a Subfolder?

Hello There is a library named TolkDotNet.dll in a c# wpf project. This library references various dll files in the x86 and x64 folders. To get rid of the file confusion, I placed them in the Lib folder as TolkDotNet, x86, x64. Then I showed the…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,777 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
asked 2024-10-06T10:13:18.32+00:00
fatih uyanık 100 Reputation points
commented 2024-10-11T03:29:28.8533333+00:00
Hongrui Yu-MSFT 1,995 Reputation points Microsoft Vendor
0 answers

.NET Framework secure .NET remoting tcp channel fails after upgrade W11 client PC to 24H2

Problem Since upgrading to Windows 11 24H2 on their client PC’s, our customers complain that they cannot use our C# client application (DTC) anymore. The DTC application was running fine on a previous Windows 11 version (and on any other OS). Our DTC…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,657 questions
asked 2024-10-10T11:12:46.7933333+00:00
Henk van der Vaart 0 Reputation points
commented 2024-10-11T02:17:33.8566667+00:00
Jiale Xue - MSFT 45,426 Reputation points Microsoft Vendor
2 answers

Facing "Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute' attribute

I have been facing the error below and have been following the main threads on Google. I've tried to delete the obj and bin folders and Rebuild the project, also updated Visual Studio, but I was not successful. Thanks for all of you that can…

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,131 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
1,000 questions
asked 2024-02-27T16:42:58.3133333+00:00
Dante Santos 5 Reputation points
answered 2024-10-10T23:24:32.13+00:00
Ajay KN 0 Reputation points
1 answer

Application_start event not firing in server, but works just fine in debug.

We have an .net framework web application running on IIS 10. I've added some code in the Application_start method of Global.asax.cs and it's not getting fired at all in the server. This is working just fine in debug using visual studio 2022 using target…

Internet Information Services
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,490 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
asked 2024-10-08T00:55:19.7766667+00:00
Anish Soman 20 Reputation points
commented 2024-10-10T22:20:49.2033333+00:00
Bruce (SqlWork.com) 65,316 Reputation points
1 answer

Reading Data from a COM Port in a .NET Console Application

How can data be read from a device connected to a computer via a COM port using a .NET console application? The device measures the weight of heavy vehicles and is connected to a weigher that displays the results. The existing application on the computer…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
asked 2024-10-10T09:17:42.73+00:00
Cenk 1,001 Reputation points
commented 2024-10-10T11:04:13.63+00:00
David Lowndes 2,535 Reputation points MVP
2 answers

Assistance Required for Resolving "System.OutOfMemoryException" in Visual Studio

Subject: Help Needed with System Out-of-Memory Issue in Visual Studio Hello Everyone, I hope you're all doing well. I'm working on a project in Visual Studio that includes a large number of forms, user controls, and images used as icons. However, I am…

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,893 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,861 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,131 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
asked 2024-10-03T23:49:42.52+00:00
Hoshyar Hussein 0 Reputation points
commented 2024-10-10T09:41:13.08+00:00
Jiachen Li-MSFT 31,411 Reputation points Microsoft Vendor
0 answers

Theming of WPF dialog not working for all controls on the dialog

Hi, I need to change color/theme of all controls on WPF dialog whenever there is change of theme from VS2022 (i.e. Tools -> Options -> Color Theme ) I followed below MSDN…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,777 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,131 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
Visual Studio Extensions
Visual Studio Extensions
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Extensions: A program or program module that adds functionality to or extends the effectiveness of a program.
219 questions
asked 2024-10-04T14:07:53.0266667+00:00
Ajay Gera 40 Reputation points
edited a comment 2024-10-10T09:03:52.27+00:00
Tianyu Sun-MSFT 30,651 Reputation points Microsoft Vendor
1 answer

How to Write a DependencyProperty for a TextBlock when it is a child element of a parent Button class in WPF C#?

Hi there, I want to make a Dependency Property for a Text Block and the functionality of this property is to apply a Scale Transformation on the Text Block but I am unable to do that Because it's a child element inside of a Button class. I have a…

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,600 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,777 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
asked 2024-10-03T02:05:10.09+00:00
MERUN KUMAR MAITY 596 Reputation points
commented 2024-10-10T08:42:05.9566667+00:00
Jack J Jun 24,491 Reputation points Microsoft Vendor
1 answer

How to retrieve variables from the Watch List in Visual Studio using DTE?

Hi everyone! I'm working with DTE in Visual Studio and trying to access variables from the Watch List window. I have code to activate the Watch window, but I'm unsure how to extract the variables and their values. Here's a snippet of my code: var…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
asked 2024-10-03T12:01:36.7133333+00:00
MypkaXD 0 Reputation points
commented 2024-10-10T06:42:27.27+00:00
Jiachen Li-MSFT 31,411 Reputation points Microsoft Vendor
2 answers

How to resolve this issue. I am getting error while sending emails

Error: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 Client not authenticated to send mail. Error: 535 5.7.139 Authentication unsuccessful, basic authentication is disabled.…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
asked 2024-09-23T12:59:17.6266667+00:00
Shiva Maurya 5 Reputation points
commented 2024-10-10T06:38:37.93+00:00
Hui Liu-MSFT 48,541 Reputation points Microsoft Vendor