Microsoft Q&A

C#

6,775 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

6,775 questions with C#-related tags

Sort by: Updated
1 answer One of the answers was accepted by the question author.

How to use authentication on a custom login.aspx webform

Please forum, I know I asked lots of questions about this issue, but I need you guys to help me out with my own code here. Recently, I read about authenticating users based on their roles. The webforms used were default webforms with its controls, but I…

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,775 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
1,148 questions
ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
362 questions
asked 2023-01-11T16:52:20.1933333+00:00 by
Donald Symmons 881 Reputation points
accepted 2023-01-13T15:59:10.1866667+00:00 by
Donald Symmons 881 Reputation points
0 answers

Validate object properties

I have objects that I am adding to a list of Interface items. My properties on my objects are strings. I was wondeing how do I make sure that my properties have values? Thanks !!! public class Pizza { public string pizzaSize {get;set;} public…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,450 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,775 questions
asked 2023-01-12T21:20:32.51+00:00 by
Ronald Rex 61 Reputation points
edited a comment 2023-01-13T15:56:02.5833333+00:00 by
AgaveJoe 16,256 Reputation points
0 answers

How to check label size?

Hello. I wanted to make a calculator, but I'm looking for a way to check if the user does not divide by 0. I wanted to do it by checking the sign before, but I don't know how to do it because my code doesn't work. private void btnZero_Click(object…

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,775 questions
asked 2023-01-13T15:50:14.86+00:00 by
Pikachu 0 Reputation points
3 answers One of the answers was accepted by the question author.

http/2 support

I don't think the standard HttpClient() can be setup to use the http/2 protocol? I cannot change the version of that to 2. I am using .NET Framework 4.6.2 Can anyone tell me what lib. i need to reference, to be able to communicate via http/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.
6,775 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
545 questions
asked 2023-01-11T14:26:39.8366667+00:00 by
Jakob Aagesen 116 Reputation points
accepted 2023-01-13T15:13:33.7033333+00:00 by
Jakob Aagesen 116 Reputation points
1 answer One of the answers was accepted by the question author.

How to Invoke a Wpf Windows in a dll Class Library

Hello, I have added a Wpf window to a class library, now the problem is how to call it from a different project.

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,138 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,775 questions
asked 2023-01-13T03:02:24.1166667+00:00 by
Marino Liranzo 1 Reputation point
accepted 2023-01-13T14:13:27.9366667+00:00 by
Marino Liranzo 1 Reputation point
0 answers

The 'AndroidSupportedAbis' MSBuild property is no longer supported. What should I change in my Android project?

I get the following warning in Visual Studio for Mac 17.5 Preview (17.5 build 1095) when I debug my Android project on my tablet: /usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/32.0.476/targets/Microsoft.Android.Sdk.Tooling.targets(5,5):…

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,775 questions
asked 2023-01-13T11:58:22.7+00:00 by
Kim Strasser 321 Reputation points
edited the question 2023-01-13T12:01:14.9666667+00:00 by
Anna Xiu-MSFT 10,756 Reputation points
1 answer One of the answers was accepted by the question author.

How check data existing or not in c# and data valid json or not

Hi All, I am creating on web API for client using complex Model. Structure of model i am giving below Public Class Organization { public Int Id{get; set;} public string Name {get; set;} public string ?website { get; set; } public …

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,775 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,450 questions
asked 2023-01-12T16:19:13.3933333+00:00 by
Binumon George 101 Reputation points
accepted 2023-01-13T11:19:52.75+00:00 by
Binumon George 101 Reputation points
0 answers

Ozeki VoIP SDK, Azure Cognitive Speech - Difficile de transférer la voix sur une ligne

Bonjour, J'essaye d'utiliser la sortie de voix azure pour l'injecter dans une conversation téléphonique avec Ozeki. Enregistrement de la ligne -> Ok Réception de l'appel externe -> Ok Génération du TTS -> Ok Connection du stream azure à…

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,775 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
545 questions
Azure Speech
Azure Speech
An Azure service that integrates speech processing into apps and services.
752 questions
Azure Cognitive Services
Azure Cognitive Services
A group of Azure artificial intelligence services and cognitive APIs that help build intelligent apps.
922 questions
asked 2023-01-13T11:11:27.37+00:00 by
Kévin Paly 0 Reputation points
0 answers

Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'Newtonsoft.Json.Linq.JArray'.

Suddenly our Function Apps start throwing the error "Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'Newtonsoft.Json.Linq.JArray'." Are there any changes in Newtonsoft library

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,775 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
2,517 questions
asked 2023-01-11T10:33:58.4333333+00:00 by
Arun Kumar KS 1 Reputation point
commented 2023-01-13T09:32:27.94+00:00 by
Jack J Jun 18,386 Reputation points Microsoft Employee
0 answers

How to host two wcf addresses in a Single Port address-One with NetTcpBinding and Other with CutomBinding

Hi All, Two WCF services must be hosted on a single port address with different relative addresses. net.tcp://localhost:8700/Applications/CM and net.tcp://localhost:8700/Applications/StreamingManager. Please refer the below App.config snippet. …

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,775 questions
Windows Communication Foundation
Windows Communication Foundation
A Microsoft runtime and set of application programming interfaces in the .NET Framework for building service-oriented applications.
257 questions
asked 2023-01-13T09:23:30.2733333+00:00 by
la07k-4914 41 Reputation points
edited a comment 2023-01-13T09:28:33.2633333+00:00 by
la07k-4914 41 Reputation points
0 answers

Specify STARTTLS credentials in XML file which is called by a C# program

We have an old program which i believe is built using C# for which i have the source code but i cannot edit the program. The issue is we have moved our email to a new provider who is using STARTTLS for sending emails and our program is now failing to…

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,775 questions
asked 2023-01-12T11:58:55.32+00:00 by
Lee 0 Reputation points
commented 2023-01-13T09:19:42.8266667+00:00 by
Jack J Jun 18,386 Reputation points Microsoft Employee
0 answers

Connection Refused Error in NetMaui Application and API

Hello, I have a Net Maui application and its API The application/API works, but when sending many requests to the server, this exception occurs: Connection refused. The API cannot be accessed from the phone browser, but it can be done from the desktop…

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
803 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,775 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
1,148 questions
asked 2023-01-13T08:57:03.2233333+00:00 by
Yusuf 591 Reputation points
2 answers

Why when generating random strings many of the string are the same/duplicated? [duplicate]

First time i used the Random instance inside the method randStr and it generated many strings the same/duplicated. so now i removed the random variable to the top and make one instance in the constructor. but still i'm getting many strings 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,138 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,775 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.
542 questions
asked 2023-01-03T08:49:31.32+00:00 by
Chocolade 451 Reputation points
commented 2023-01-13T08:51:58.1133333+00:00 by
Hui Liu-MSFT 14,206 Reputation points
2 answers

What is the best way to communicate with the database through Datagrid in C# WPF between DataSet and Entity?

I use C# WPF, I am programming an accounting program with a SQL Server database, in this accounting program, data is inserted, updated, and deleted by the user directly in a data grid, which contains a textbox and Combobox elements. In an issue…

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,138 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,775 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.
542 questions
asked 2023-01-07T20:19:39.27+00:00 by
Mojtaba_Hakim 251 Reputation points
commented 2023-01-13T08:48:03.23+00:00 by
Hui Liu-MSFT 14,206 Reputation points
1 answer

How to find the index of a newly added item in a ListView collection

I have a ListView element using a GridView. The ListView.ItemsSource property is bound to a CollectionViewSource. When I add a new item to the collection, the item appears successfully in the grid but I cannot determine the index at which it appears…

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,775 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.
542 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,138 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
545 questions
asked 2023-01-12T15:00:24.92+00:00 by
Charles Burkitt 0 Reputation points
commented 2023-01-13T08:43:45.5633333+00:00 by
Hui Liu-MSFT 14,206 Reputation points
1 answer

Single Code, Single UI web application + apps

I want to create a web application which can be extended by apps too. [single coding, single html ui - reusable as website, ios app, android app - no desktop app] Is .Net MAUI the best tool to create same? What are the design & strategies…

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,775 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
803 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.
760 questions
asked 2023-01-13T01:30:19.5066667+00:00 by
Kevin Azure 101 Reputation points
answered 2023-01-13T07:58:04.9733333+00:00 by
1 answer

Azure web app giving 502 errors intermittently

I have developed a web app by using .net mvc framework to upload videos directly into blob storage. I have deployed this on my azure web app which previously had plan B1 where I used to get 502 issues. So I looked into "Diagnose and solve…

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,775 questions
Azure Web Apps
Azure Web Apps
A feature of Azure App Service used to create and deploy scalable, mission-critical web apps.
4,228 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
1,375 questions
asked 2023-01-12T07:05:06.57+00:00 by
Rajat Kumar Jha 0 Reputation points
answered 2023-01-13T07:01:53.0766667+00:00 by
VenkateshDodda-MSFT 5,851 Reputation points Microsoft Employee
1 answer

Why my web app gets very slow to respond in azure portal?

Hi, I'm having problems with my domain because sometimes this app becomes very slow to respond, I've to restart it to fix it. it is happening every day. I checked under the "Diagnose and solve problems >> Availability and Performance"…

Azure Web Apps
Azure Web Apps
A feature of Azure App Service used to create and deploy scalable, mission-critical web apps.
4,228 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,450 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,775 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
1,771 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
136 questions
asked 2023-01-12T06:53:23.3533333+00:00 by
Developer 0 Reputation points
edited an answer 2023-01-13T06:48:04.91+00:00 by
JasonPan - MSFT 1,066 Reputation points Microsoft Employee
0 answers

UWP CreateOutputReport failed to create report ID

The following code has an error, System. Exception: "The data is invalid. The specified report type is not present. What is the reason? Error statement: var outputReport = hiddevice.CreateOutputReport(0);  The handle was opened, but the output…

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,775 questions
Universal Windows Platform (UWP)
asked 2023-01-13T03:54:22.5666667+00:00 by
yu chen 0 Reputation points
commented 2023-01-13T06:27:53.75+00:00 by
Junjie Zhu - MSFT 5,461 Reputation points
1 answer

Get Sharepoint Document FileVersions using C#

Hi: My question is to retrieve document version history including the current version. I used the below, and I am able to get the version history but in that list current version data is not included. instead current version details are loaded…

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,775 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
5,866 questions
asked 2023-01-07T18:51:12.823+00:00 by
Deepthi Vangapandu 1 Reputation point
commented 2023-01-13T06:09:28.7566667+00:00 by
RaytheonXie_MSFT 13,836 Reputation points