10,597 questions with C#-related tags

Sort by: Updated
2 answers

Task - await - synchron - async

Hello! My goal is to send a request and receive an answer. I have a C# WinForm application. The button is synchronous Task<(bool, string, int)> task = Task.Run<(bool, string, int)> I can write it that way for the call, that is usual and…

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,597 questions
asked 2024-07-11T18:10:59.4966667+00:00
Noah Aas 380 Reputation points
answered 2024-07-12T09:36:03.3533333+00:00
Jiale Xue - MSFT 42,321 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

How to replace OperationContext in new V12 SDK Azure.Storage.Blobs

I'm switching from Microsoft.WindowsAzure.Storage to Azure.Storage.Blobs. In the former versions I could log retries, this seems to be missing in the new SDK. I used OperationContext for this: var context = new OperationContext(); …

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,869 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,891 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,594 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,597 questions
asked 2024-06-04T11:18:12.8033333+00:00
Becker, W 66 Reputation points
edited a comment 2024-07-12T04:31:23.6533333+00:00
David Moksha 0 Reputation points Microsoft Employee
1 answer

How to register device on Entra ID programatically

Hi , I want to register my local device to Entra ID using c#. I have gone through the Microsoft Graph API documentation as well but didn't get any information related to this topic please help me.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,344 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,597 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,513 questions
asked 2024-07-09T07:45:18.6466667+00:00
Akesh Jadhav 0 Reputation points
commented 2024-07-12T04:28:03.8066667+00:00
Shweta Mathur 29,341 Reputation points Microsoft Employee
2 answers

I am using the MVVM pattern and I want to get the value of the property in the OnPropertyChanged event

I want to get the value of the property in the OnPropertyChanged event. I would rather not use reflection.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,173 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,597 questions
asked 2024-07-10T16:20:54.3866667+00:00
Tom Meier 220 Reputation points
answered 2024-07-12T02:52:33.5933333+00:00
Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 38,756 Reputation points Microsoft Vendor
0 answers

Issues with Access Permissions in PhoneLineTransportDevice API on Windows 11

I am currently working on a hands-free application on Windows and using the PhoneLineTransportDevice API. To utilize the features of this API, I initially request access permissions using the PhoneLineTransportDevice.RequestAccessAsync() method. This…

Universal Windows Platform (UWP)
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,597 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,857 questions
asked 2024-07-07T03:07:39.5133333+00:00
Taylor Yi 0 Reputation points
edited a comment 2024-07-11T23:03:31.32+00:00
Taylor Yi 0 Reputation points
2 answers One of the answers was accepted by the question author.

REST interface possibilities

Hello, I have seen a code snippet like this, can I return more than two objects in this task? Then I can ask it like this. bool responseState = false; string responseData = ""; (responseState, responseData) = await…

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,597 questions
asked 2024-07-04T17:26:43.7733333+00:00
Noah Aas 380 Reputation points
accepted 2024-07-11T18:08:47.1133333+00:00
Noah Aas 380 Reputation points
2 answers

shut off monitor will flash display,by use SendMessage command.

SendMessage function Win32 API Windows and Messages Similar problems monitor-will-flash-before-shut-off-or-monitor-will.html screen recording onedrive using System; using System.Runtime.InteropServices; namespace ConsoleApp { …

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,507 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,597 questions
asked 2022-06-20T07:16:44.397+00:00
microsoft 1 Reputation point
edited a comment 2024-07-11T15:38:09.1233333+00:00
Alan T 0 Reputation points
1 answer One of the answers was accepted by the question author.

Changing Taskbar (Shell_TrayWnd) Color to Transparent

0 I found a way to change color to fully transparent, by researching structure of DesktopWindowXamlSource of Taskbar (Shell_TrayWnd). I'm curious is it possible to somehow change BackgroundFill in DesktopWindowXamlSource to Windows.UI.Xaml.Media.Brush…

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,031 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,507 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,597 questions
asked 2024-07-09T09:51:43.66+00:00
Jacob Mordon 65 Reputation points
accepted 2024-07-11T11:32:45.5+00:00
Jacob Mordon 65 Reputation points
2 answers One of the answers was accepted by the question author.

<Title> tag not reflected in AssemblyInfo.cs

Hello <Title> tag is not reflected in the generated AssemblyInfo.cs. ConsoleApp1.csproj <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> …

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,592 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,844 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,597 questions
asked 2024-07-11T09:58:48.1333333+00:00
Hideo Yamada 20 Reputation points
accepted 2024-07-11T10:33:33.63+00:00
Hideo Yamada 20 Reputation points
1 answer One of the answers was accepted by the question author.

Validate Xml file

Hello, I just need to verify if a file is xml, no specific structure, so just loading to an xml parser and if no exception is thrown at load, I'm fine with it, so I use: Dim doc As XDocument doc = XDocument.Load(InputStream, LoadOptions.None) Check for…

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,597 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,651 questions
asked 2024-07-11T02:55:36.5266667+00:00
StewartBW 805 Reputation points
accepted 2024-07-11T09:41:17.68+00:00
StewartBW 805 Reputation points
1 answer

Help Needed: Errors in Initial .NET MAUI Project

I have created my first .NET MAUI project several times, but to my surprise, errors appear without changing any line of code. Although the application runs fine, the lines remain underlined. I have captured a screenshot so you can see the issue and guide…

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,173 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,597 questions
asked 2024-07-08T01:24:07.06+00:00
Roberto C 120 Reputation points
commented 2024-07-11T06:09:52.9866667+00:00
Leon Lu (Shanghai Wicresoft Co,.Ltd.) 71,681 Reputation points Microsoft Vendor
1 answer

I dont understand why OnPropertyChanged is not firing in neither my Model or ViewModel

I am using the MVVM Community Tollkit and below is the generated code. I also included my Model code and the OnPropertyChanged Method. I put a breakpoint in the generated code on the property Spousessn and it was fired and OnPropertyChanged in the…

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,173 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,597 questions
asked 2024-07-09T21:32:59.66+00:00
Tom Meier 220 Reputation points
commented 2024-07-11T06:05:01.6966667+00:00
Leon Lu (Shanghai Wicresoft Co,.Ltd.) 71,681 Reputation points Microsoft Vendor
1 answer

How to Create a Device on AAD Using Microsoft Graph API ?

I'm trying to use the Microsoft Graph API to create a device in Microsoft Entra ID. I need to generate a device ID and include it in the deviceid property of the POST request. Additionally, I want to know if this API call can join my Windows machine to…

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,344 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,597 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,513 questions
asked 2024-07-10T11:26:38.5+00:00
sarvesh chaudhari 0 Reputation points
answered 2024-07-11T05:09:19.66+00:00
Givary-MSFT 30,431 Reputation points Microsoft Employee
0 answers

Timer Function returns 404 on consumption plan. cronjob but http fn invokes ok

Timer function returns 404 from both postman and Az Portal test/run. Http function executes from Postman and from Az Portal test/run, OK. App is deployed from GitHub Action. I have used Restart and Refresh but cron job does not fire. Publishing model:…

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,601 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,597 questions
asked 2024-07-09T03:41:19.5333333+00:00
ozbobwa 21 Reputation points
edited a comment 2024-07-11T01:52:41.02+00:00
ozbobwa 21 Reputation points
2 answers

C# app, Long Path support on Windows 10 post-1607, .NET 4.6.2.

Hello, I've got an app where long path support is now needed. It's running on Windows 10 post-1607, long paths have been enabled via group policy. When the app was targeting 4.6.1, it threw the PathTooLongException what a System.IO.FileInfo object 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.
10,597 questions
asked 2021-01-21T23:07:31.533+00:00
Severian 6 Reputation points
commented 2024-07-11T01:18:48.9466667+00:00
Danial H 1 Reputation point
1 answer

How to get SSO SAML token using C# from Azure Active Directory

Hi everyone, Just a quick question. Is it possible using C# to authenticate an account in Azure Active Directory and retrieve an SAML token back? If so, how can we go about doing this? Many thanks

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,182 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,597 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,319 questions
asked 2024-07-10T15:46:35.85+00:00
Sigusmund 0 Reputation points
answered 2024-07-10T22:05:23.8566667+00:00
Bruce (SqlWork.com) 60,866 Reputation points
1 answer One of the answers was accepted by the question author.

.Net Maui Validate Property of a Model in the ViewModel Class

I am using MVVM along with the MVVM Community Toolkit. I have a Constructor in my .Net Maui ViewModel public EmployeeEditViewModel() { CompanyInfo= new PYEModel(); } I have an Observable property in the .Net Maui ViewModel…

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,173 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,597 questions
asked 2024-07-08T19:52:09.4566667+00:00
Tom Meier 220 Reputation points
commented 2024-07-10T17:34:08.54+00:00
Bruce (SqlWork.com) 60,866 Reputation points
3 answers One of the answers was accepted by the question author.

VS 2022 Not showing red squiggles under errors when i debug projects saved on network disk

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,592 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,597 questions
asked 2024-06-21T05:42:45.41+00:00
Willis1962 25 Reputation points
edited a comment 2024-07-10T16:52:30.0033333+00:00
Alberto La Greca 0 Reputation points
1 answer One of the answers was accepted by the question author.

XDocument vs XmlDocument

Hello experts, To load and parse PAD xml from string which one is recommended to use, ie faster or more…

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,597 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,651 questions
asked 2024-07-09T21:01:18.96+00:00
StewartBW 805 Reputation points
commented 2024-07-10T13:15:57.63+00:00
Dewayne Basnett 1,361 Reputation points
1 answer One of the answers was accepted by the question author.

How to scroll in the tabs area in TabView in WinUI3 by using code

There are many tabs in a TabView Control in WinUI3 App. I made a function: pin a selected tab to top. After set it to the top (meaning the first tab ), I make it be selected. Everything is ok, but the first selected tab may be hidden if I had previously…

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.
749 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,597 questions
asked 2024-07-05T08:19:01.0566667+00:00
C CB 145 Reputation points
accepted 2024-07-10T09:27:50.8033333+00:00
C CB 145 Reputation points