Microsoft Q&A

C#

6,920 questions

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.

Browse all C# tags

1,247 questions with C#-related tags

Sort by: Updated
0 answers

Generate a simple message from controller (blazor page not for razor view)

In a Blazor server application, I have implemented user authentication via cookie. In the Blazor page (not razor view) I have created a form with email and password entries as well as a button for sending the data. The method is Post and is run on the…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,531 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
783 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.
6,920 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
582 questions
asked 2023-01-29T12:11:47.5833333+00:00
perfect code 101 Reputation points
commented 2023-01-29T12:42:24.98+00:00
AgaveJoe 16,946 Reputation points
0 answers

WPF Mousemove is a noticeable lag

I am making a UserControl called VolumeScrollBar to control the volume a video player I am working on. Now the problem I am having is when I slide my SwitchPath it moves noticeable slower than my mouse. How can I fix this ? note: everything is working…

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.
6,920 questions
asked 2023-01-29T06:16:37.1733333+00:00
Brandon Boone 1 Reputation point
0 answers

C# TCP/IP, Client with reconnect and timeout

Hello, I am looking for a good example how to create a client. There should be a timeout if no connection could be created. Then until 3 times automatic retry. If there is no response after the request, there should be error message, timeout. The request…

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.
6,920 questions
asked 2023-01-26T16:59:17.22+00:00
Markus Freitag 2,961 Reputation points
commented 2023-01-27T17:21:24.3133333+00:00
Markus Freitag 2,961 Reputation points
0 answers

Shell Navigation and using a Dictionary to pass values.

I am trying to learn how to pass complex data types to a page using a Dictionary. As you can see in the example code below that Name was hardcoded, but I was wondering what is the best practice if I wanted to dynamically set the Name property in the view…

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.
6,920 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
876 questions
asked 2023-01-27T15:01:59.6933333+00:00
Ronald Rex 506 Reputation points
edited the question 2023-01-27T15:16:32.2166667+00:00
Ronald Rex 506 Reputation points
0 answers

Change InkDrawingAttributes Opacity for Pen brush

I using a color picker to draw with a pen, but using this code I can't change de opacity of the pen color: InkDrawingAttributes inkDrawingAttributes = InkCanvas.InkPresenter.CopyDefaultDrawingAttributes(); inkDrawingAttributes.Color =…

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.
6,920 questions
Universal Windows Platform (UWP)
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
556 questions
asked 2023-01-26T14:51:19.3+00:00
Anderson Cavalcante 21 Reputation points
commented 2023-01-27T11:21:50.61+00:00
Anderson Cavalcante 21 Reputation points
0 answers

How to download rest api response content into excel using windows forms application c#

I'm trying to download REST API response content as (original format) excel (.xlsx) And I have used this method to return the response content public static string DownloadFileName() { try { var client = 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.
6,920 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
61 questions
asked 2023-01-27T07:47:50.0733333+00:00
Ashok Kumar 121 Reputation points
edited the question 2023-01-27T07:56:11.2433333+00:00
Ashok Kumar 121 Reputation points
0 answers

C#: How do I read the full output of a command (given via a .bat file)?

Hello everyone. I must admit that I am really a beginner with C#. I have to develop software for Windows 10 Enterprise LTSC Embedded which among other things has to parse the output of the uwfmgr.exe get-config command (contained in the UWFStatus.bat…

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.
6,920 questions
asked 2023-01-20T08:41:35.3+00:00
Alessia La Manna 0 Reputation points
commented 2023-01-26T13:33:13.6+00:00
Alessia La Manna 0 Reputation points
0 answers

c# Button execute value fro profile

I want under the button a cmd.exe executen I have unde the properties the following configured: <setting name="CMD" serializeAs="String"> <value>C:\Windows\System32\cmd.exe</value> …

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.
6,920 questions
asked 2023-01-24T15:54:30.0766667+00:00
Jan Meeling 0 Reputation points
commented 2023-01-25T13:48:43.5233333+00:00
Jan Meeling 0 Reputation points
0 answers

ZipFile.CreateFromDirectory() looks like working, but zip file size is smaller than expected one.

Hi, I made a C# progrm which make a zip file, and save it to spedific folder on another drive. Yes, it's back up program. Zipping is taken in another independent thread. My program created zip file when the time is on my setup exactly. Problem is…

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.
6,920 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
599 questions
asked 2023-01-25T12:38:18.48+00:00
WB_78 0 Reputation points
commented 2023-01-25T13:07:44.32+00:00
Reza Aghaei 2,851 Reputation points Microsoft MVP
0 answers

Best way to unit test cancellation

Good evening. I have been trying to write a unit test that will test the cancellation of a method. Now I have a unit test written that passes, but I am do not think it is what I am looking to achieve. I have tried a few different ways to achieve 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.
6,920 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying a test as a means of analysis or diagnosis.
249 questions
asked 2022-07-22T02:01:05.437+00:00
Michael Mastro II 26 Reputation points
commented 2023-01-25T09:50:02.16+00:00
Christoph 0 Reputation points
0 answers

Why is the combo box cursor/caret moves to the beginning when down arrow is hit?

In my app I have a combo box <ComboBox ItemsSource="{Binding ComboItems}" SelectedItem="{Binding SelectedCBItem}" StaysOpenOnEdit="True" Text="{Binding SelectedCBItem,…

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.
6,920 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,170 questions
asked 2023-01-23T05:18:53.03+00:00
don bradman 371 Reputation points
commented 2023-01-25T09:15:22.2633333+00:00
don bradman 371 Reputation points
0 answers

How do I add my company subscription Id?

Hi all, I would like to add my company Subscription ID to my subscriptions. Is that possible?

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.
6,920 questions
asked 2023-01-24T22:55:45.2633333+00:00
Diego Contreras 0 Reputation points
commented 2023-01-25T01:36:34.0033333+00:00
Jack J Jun 19,036 Reputation points Microsoft Employee
0 answers

How to search dictionary key and find the value in C#?

Hello: I have the following Json data stored into one dictionary: public class JsonKey { public int? Index { get; set; } public string? ID { get; set; } public string? Name { get; set; } …

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.
6,920 questions
asked 2023-01-24T20:34:08.8733333+00:00
john zyd 406 Reputation points
0 answers

How to use Json Data as dictionary key and find the value?

Hello: I have the following Json data stored into one dictionary: (newtonsoft.json) public class JsonKey { public int? Index { get; set; } public string? ID { get; set; } public string? Name { get; set;…

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.
6,920 questions
asked 2023-01-24T20:30:06.5233333+00:00
john zyd 406 Reputation points
0 answers

Why does the onclick event not work, in my razor pages hosted blazor component, in .net 7.0?

I've used the following code in multiple blazor web assembly applications hosted on a razor pages page under .net 5.0 and .net 6.0 before now. An application I was forced to upgrade to .net 7.0 has rendered the onclick command completely useless What…

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.
6,920 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,531 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
783 questions
asked 2023-01-19T00:23:45.6266667+00:00
The Acme Cheese Company 0 Reputation points
edited a comment 2023-01-24T18:43:20.06+00:00
The Acme Cheese Company 0 Reputation points
0 answers

Field never assigned and will always have null value

Delete all file from filesystemwatcher

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.
6,920 questions
asked 2023-01-21T13:25:43.35+00:00
MiPakTeh 1,286 Reputation points
commented 2023-01-24T08:47:05.5366667+00:00
MiPakTeh 1,286 Reputation points
0 answers

How to show all data or text in Xvalue using Graph in c# 2019

Good day, I have a problem with my graph. Please see the picture below. This is my graph problem, not all datetime has display. I don't know what the problem, please help me to fix this problem.

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.
6,920 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
2,394 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
2,616 questions
asked 2023-01-20T10:21:43.8033333+00:00
Jay-R Hayashi 66 Reputation points
commented 2023-01-24T08:19:16.5766667+00:00
Jack J Jun 19,036 Reputation points Microsoft Employee
0 answers

File type cannot be inspected, CorrelationId=4ac4cbff-e67f-4ce9-81b7-254d7728cdb9, CorrelationId.Description=FileHandler

Hi Team, I'm using Microsoft Graph v1.0 to read emails. Recently we started receiving emails which are encrypted with below label. When I'm trying to read the attachments of these emails, I'm receiving RPMSG file which I'm unable to decrypt. I'm using…

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.
6,920 questions
Microsoft Graph Mail API
Microsoft Graph Mail API
A Microsoft API that supports accessing data in users' primary mailboxes and in shared mailboxes.
676 questions
asked 2023-01-23T15:13:00.7933333+00:00
Tejasvini Shelar 0 Reputation points
edited the question 2023-01-24T03:23:59.9066667+00:00
Jack J Jun 19,036 Reputation points Microsoft Employee
0 answers

mscorlib.resources.dll Module was built without symbols

Intento depurar un proyecto WFC pero me da error: Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_es_b77a5c561934e089\mscorlib.resources.dll'. Module was built without symbols. An unhandled exception of type…

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
2,394 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.
6,920 questions
asked 2023-01-23T11:43:14.8933333+00:00
Daniel Egea Almagro 0 Reputation points
commented 2023-01-24T01:12:55.39+00:00
Jack J Jun 19,036 Reputation points Microsoft Employee
0 answers

Is possible to use the same background process for all forms?

Can I use the same background process for all forms in visual studio c#? If it possible, how is it done?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
2,394 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.
6,920 questions
asked 2023-01-22T21:10:55.3166667+00:00
Ken Ekholm 21 Reputation points
commented 2023-01-22T23:40:10.2933333+00:00
Karen Payne MVP 29,226 Reputation points Microsoft MVP