11,236 questions with C#-related tags

Sort by: Updated
4 answers

HttpClient // Timeout // The remote name could not be resolved

Hello, The remote name could not be resolved using (HttpClient client = new HttpClient()) { client.BaseAddress = new Uri(System.BaseAddress); client.Timeout = new TimeSpan(0, 0, System.Timeout); public void Exception(Exception ex, string…

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,577 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.
11,236 questions
asked 2025-01-23T18:48:34.5966667+00:00
Noah Aas 545 Reputation points
edited a comment 2025-01-26T00:55:15.42+00:00
SurferOnWww 3,806 Reputation points
2 answers

Why can't I create an account in Azure?

Why can't I register a me to Azure? My phone number is not accepted. It says that I shouldn't add my country code, which I haven't done either. I've tried with both my phone numbers but it doesn't work!

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.
11,236 questions
asked 2025-01-24T22:58:58.56+00:00
Jan Brikell 0 Reputation points
answered 2025-01-25T21:33:22.2233333+00:00
Jan Brikell 0 Reputation points
3 answers

How to know whether the snap applied in windows 11 windows. Is there any API.

Is there a method or any API to tell if snap is enabled or disabled in Windows 11? Please answer if there is any other way.

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,817 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.
11,236 questions
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.
830 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,531 questions
asked 2022-04-26T04:51:23.56+00:00
visi venkat 1 Reputation point
commented 2025-01-25T13:41:37.2766667+00:00
Castorix31 86,506 Reputation points
0 answers

EntraID Application User Custom Properties

I am developing an online business portal for Employees at 100+ locations around the country. Each location has a LocationCode and orders and customer data are related to the location code in ERP databases. I am currently using EntraID Application…

Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
1,083 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.
11,236 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,993 questions
asked 2025-01-24T17:59:32.33+00:00
J Shaw 0 Reputation points
0 answers

Why is CS0472 just a warning?

I found a warning CS0472 from the C# compiler. I have this in my code: List<string> list = GetList(); if (list.Count == null) // CS0472 DoA(); else DoB(); Why is it just a warning? IntelliSense tells me that this expression is always…

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.
11,236 questions
asked 2025-01-24T17:46:53.5733333+00:00
Heiko 1,286 Reputation points
4 answers

SqlDataReader error “Invalid attempt to read when no data is present”

My environment used is Visual Studio 2022 v17.12.4. Language is C# and connecting to SQL Server Express v16.0.1135.2. This is a Windows form using .Net Framework 4.8.1. I am getting the error message “Invalid attempt to read when no data is present”…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,066 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,369 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.
11,236 questions
asked 2025-01-21T22:31:10.9133333+00:00
Pat 0 Reputation points
commented 2025-01-24T16:06:17.0633333+00:00
Pat 0 Reputation points
1 answer One of the answers was accepted by the question author.

How to fix SystemLoadExecption

Exception has occurred: CLR/System.TypeLoadException An unhandled exception of type 'System.TypeLoadException' occurred in Winappli.dll: 'Could not load type 'Microsoft.Toolkit.Uwp.Notifications.NotificationActivator' from assembly…

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,919 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.
11,236 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,531 questions
asked 2024-07-23T23:13:08.8466667+00:00
Nat323 25 Reputation points
commented 2025-01-24T15:38:19.6066667+00:00
Max Schmidt 0 Reputation points
2 answers One of the answers was accepted by the question author.

The type or namespace 'SharePointOnlineCredentials' could not be found.

How do you resolve this error? I installed SharePoint.Client and SharePoint.Client.Runtime. I referenced Microsoft.SarePoint.Client in my app.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,120 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.
11,236 questions
asked 2022-10-12T13:45:35.13+00:00
Ariel M 51 Reputation points
commented 2025-01-24T14:32:55.71+00:00
Kevin Wright 0 Reputation points
1 answer

C# Array - getting "System.IndexOutOfRangeException" but dont understand why.

Hi namespace ConsoleApp3 { internal class Program { static void Main(string[] args) { string[] personNamn = new string[3]; personNamn[0] = "A"; personNamn[1] = "B"; personNamn[2] =…

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.
11,236 questions
asked 2025-01-24T08:28:04.7733333+00:00
JA 0 Reputation points
commented 2025-01-24T14:16:12.7866667+00:00
Jiale Xue - MSFT 48,856 Reputation points Microsoft Vendor
1 answer

How to Save a WPF DataGrid Back to Database after Editing

Hi, I am wondering if theirs a way to save a updated Line from WPF DataGrid back to Database . I don't Know the best way to do this without going back to WinForms Apps. I would like to use WPF, any help would be appreciated.

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,817 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.
11,236 questions
asked 2025-01-22T21:17:16.64+00:00
Luke A'Court 0 Reputation points
commented 2025-01-24T13:46:12.9233333+00:00
Luke A'Court 0 Reputation points
0 answers

Unable to Post a Message to Teams Channel with Graph API Client + C#

Hi, We are trying to post a message to teams channel, with Channel.SendMessage delegated permissions. And here is the code snippet. var options = new OnBehalfOfCredentialOptions { AuthorityHost = AzureAuthorityHosts.AzurePublicCloud, ``` }; var…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,066 questions
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,732 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,869 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,376 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.
11,236 questions
asked 2025-01-24T13:18:50.09+00:00
0 answers

Windows Community Toolkit AdaptiveGridView incorrect behavior

Hi, has anyone had this problem when using AdaptiveGridView (Win UI platform). The elements do not want to expand to occupy the full width available for them in the row (I attach a photo). I'll leave you the code for setting the AdaptiveGridView so that…

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
12,001 questions
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.
11,236 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,531 questions
asked 2025-01-24T13:00:01.3166667+00:00
123244 80 Reputation points
0 answers

Issue with "Mandatory" package update status in Microsoft Store

Hi, I am experiencing an issue with the Microsoft Store incorrectly reporting "Mandatory" package update status in some of my UWP applications. Following the official documentation, I implemented an update flow in my application that provides…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,066 questions
Universal Windows Platform (UWP)
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.
814 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.
11,236 questions
asked 2025-01-24T12:43:15.7233333+00:00
Joel 0 Reputation points
2 answers

I get a permissions error sending email with MS Graph

I am getting a permissions error and not able to find an answer. To be sure, I even set up a second new Azure portal and subscription, again followed the instructions, again got the same error. I must be missing something basic. One of the issues I guess…

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,869 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.
11,236 questions
asked 2025-01-24T02:34:07.81+00:00
Steve Worthington 0 Reputation points
edited an answer 2025-01-24T11:55:23.3133333+00:00
Yakun Huang-MSFT 9,470 Reputation points Microsoft Vendor
1 answer

How to fix StackOverflowException when using the C# Graph SDK

At the moment we are struggling with the API connection used by the Microsoft Graph SDK for C#. I can't find any code which should generate a System.StackOverflowException and the calls that the SDK makes work most times and sometimes it just gives the…

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,869 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.
11,236 questions
asked 2023-04-12T13:06:01.21+00:00
Marc ten Cate 31 Reputation points
commented 2025-01-24T11:06:14.2766667+00:00
Ian Newborn 1 Reputation point
7 answers One of the answers was accepted by the question author.

How to create Excel file with Visual Studio 2022 and C#

I'm working with Visual Studio 2022, Project WPF C# with .Net 6.0 and Entity Framework Core. DataBase MS SQL Express.I have also a valid and active licence Microsoft Office 365. I try to Create an Excel File but I have different error msg (see…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,066 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
2,107 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.
11,236 questions
asked 2023-08-06T15:37:30.7133333+00:00
Dmtr_Grms 331 Reputation points
answered 2025-01-24T10:28:07.3566667+00:00
Stefan Krabbe 0 Reputation points
1 answer

How to upload a file from my local computer to a Sharepoint folder

Hi,  I´m using something like this:   string userName = “nelson.soares@********.pt”; string password = “*********”; var securePassword = new SecureString();   foreach (char c in password) {  securePassword.AppendChar(c); }  using (var…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,066 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,120 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.
11,236 questions
asked 2025-01-22T20:48:33.8166667+00:00
Nelson Soares 0 Reputation points
commented 2025-01-24T10:16:28.4066667+00:00
Yanli Jiang - MSFT 28,536 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

As per Official Documentation we can get Get Selected Fields ,but using solution(Provided by : https://learn.microsoft.com/en-us/graph/api/listitem-list?view=graph-rest-1.0&tabs=csharp) can not get desired output

I want to get below result [ { "@odata.etag": "\"65dba275-af1c-4ff4-b85b-4afde8046f07,10\"", "id": "11", "fields@odata.context":…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,755 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,869 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,120 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.
11,236 questions
asked 2025-01-23T11:19:50.6833333+00:00
Marcelo Lorenzetti 20 Reputation points
accepted 2025-01-24T09:15:29.65+00:00
Marcelo Lorenzetti 20 Reputation points
0 answers

Textbox for input password then need save some place

using System; using System.Windows.Forms; public class PasswordForm : Form { private TextBox passwordTextBox; public PasswordForm() { // Initialize the TextBox passwordTextBox = new TextBox(); …

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.
11,236 questions
asked 2025-01-24T02:53:12.1366667+00:00
botak abang 0 Reputation points
commented 2025-01-24T07:27:17.4966667+00:00
Jiale Xue - MSFT 48,856 Reputation points Microsoft Vendor
1 answer

How to get the current page number or check if PDF viewer is on the Last page of a PDF in WPF Webview2 control?

I am working on a WPF application where I use Webview2 to display PDF files. I rely on Edge's built in PDF rendering mechanism and am not using any external PDF libraries. I've successfully loaded the PDF using the following…

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,817 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.
11,236 questions
asked 2025-01-23T07:01:02.52+00:00
Praveena S Kumar 0 Reputation points
commented 2025-01-24T05:34:51.5033333+00:00
Hongrui Yu-MSFT 4,195 Reputation points Microsoft Vendor