11,238 questions with C#-related tags

Sort by: Updated
0 answers

Gzip file uploaded to Azure Blob Storage, when downloaded to Windows machine does not open and the file size is not same

I am uploading a csv file with gzip encoded to Azure Blob Storage using C# .net 8. I am able to read the file ok when I download file and read data use .Net code. But I have two problems. When I download the file to my local Windows laptop and try to…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,067 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,047 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,238 questions
asked 2025-01-27T13:46:41.1433333+00:00
Arvind V 1 Reputation point
3 answers One of the answers was accepted by the question author.

How to view my content from my database to my home view in .Net core MVC

Hi guys SO I was learning to use .NET Core MVC through the tutorial, and I decided to take it up a notch. While the tutorial has been helpful, it did not really have what I was looking for, and surprisingly, neither do all the AI bots. So what's the…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,756 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,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,238 questions
asked 2025-01-18T15:28:13.7133333+00:00
Assadullah Sanusi 20 Reputation points
commented 2025-01-27T13:34:34.9366667+00:00
Assadullah Sanusi 20 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,067 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,238 questions
asked 2025-01-24T12:43:15.7233333+00:00
Joel 0 Reputation points
commented 2025-01-27T13:17:55.2033333+00:00
Joel 0 Reputation points
3 answers

Prevent app from closing by task manager

I am creating an application in VS 2019. It should not be closed by task manager. For ex, McAfee does not get closed in Windows task manager even when user tries to kill it. Same logic I want to implement in my app. Should I create a C# Windows…

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
12,007 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,238 questions
asked 2021-06-14T13:06:21.917+00:00
TkTech 56 Reputation points
commented 2025-01-27T11:49:27.7933333+00:00
Anas Malik 0 Reputation points
0 answers

AppDomain.CurrentDomain.BaseDirectory is Empty While Loading Media In WPF

Hello, I am working on a WPF window which supports multiple frameworks <TargetFrameworks>net8.0-windows;net48</TargetFrameworks> i have a media element in a window written <MediaElement x:Name="Video"                          …

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,067 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,818 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,238 questions
asked 2025-01-27T04:47:18.25+00:00
commented 2025-01-27T11:43:10.6566667+00:00
2 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,238 questions
asked 2025-01-24T17:46:53.5733333+00:00
Heiko 1,286 Reputation points
answered 2025-01-27T11:32:33.28+00:00
Heiko 1,286 Reputation points
0 answers

Issue with saving single record the form saves multiple records until the modelstate is valid

I am using asp.net core 8 i have a popup form when i click submit with empty fields it returns required validation error and when i fill data in fields then submit again it save multiple records is sql database the number of time i click on submit…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
774 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,756 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,238 questions
asked 2025-01-27T07:05:16.65+00:00
Asif_360 0 Reputation points
commented 2025-01-27T10:13:50.32+00:00
Asif_360 0 Reputation points
5 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,067 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,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,238 questions
asked 2025-01-21T22:31:10.9133333+00:00
Pat 0 Reputation points
commented 2025-01-27T09:27:09.95+00:00
Karen Payne MVP 35,476 Reputation points
3 answers

How To Print QRCode in Thermal Printer

Hi, can anyone help me with this situation? I'm in need of help printing a QR code using Xamarin.Forms (iOS and Android) (I just need the Android version). I have an Thermal Printer, and im already printing text through the BluetoothSocket, and i can…

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,372 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,238 questions
asked 2021-11-02T15:22:24.02+00:00
kelputoo 1 Reputation point
edited the question 2025-01-27T09:13:49.28+00:00
TP 102K Reputation points
1 answer

I want to lock the current HDMI port in C# WPF (.NET Framework)?

I want to lock the HDMI port. If a HDMI port is used for a monitor then if other HDMI port is used then i want to lock existing port. How to do so in C# WPF?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,067 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,818 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,716 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,238 questions
asked 2025-01-16T08:11:55.82+00:00
Vishal2 Bansal 225 Reputation points
commented 2025-01-27T08:54:03.0933333+00:00
Roy Li - MSFT 33,591 Reputation points Microsoft Vendor
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,067 questions
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,739 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,882 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,238 questions
asked 2025-01-24T13:18:50.09+00:00
commented 2025-01-27T08:49:53.5766667+00:00
LiweiTian-MSFT 23,035 Reputation points Microsoft Vendor
0 answers

How to Disable Scrolling in a Navigation View with WindowsAppSDK

I have a WindowsAppSDK app that uses a navigation view control for navigation. For one of the pages, scrolling should be disabled, allowing the page to shrink to fit within the navigation view's content pane. How can scrolling be disabled and the page…

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,238 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
asked 2025-01-17T22:59:10.8633333+00:00
jm6271 20 Reputation points
commented 2025-01-27T08:47:28.2166667+00:00
Roy Li - MSFT 33,591 Reputation points Microsoft Vendor
1 answer

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,007 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,238 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,547 questions
asked 2025-01-24T13:00:01.3166667+00:00
123244 80 Reputation points
answered 2025-01-27T06:49:24.59+00:00
Junjie Zhu - MSFT 20,021 Reputation points Microsoft Vendor
1 answer

In Azure Web PubSub, How to receive messages in backend microservice for processing

Requirement: My clients are using simple WebSocket connection to send messages. I want to receive these messages inside my backend .NET 8 web api and process them further to send fine-tuned data to some distributed cache services. From documentation, I…

Azure Web PubSub
Azure Web PubSub
An Azure service that provides real-time messaging for web applications using WebSockets and the publish-subscribe pattern.
82 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,756 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,238 questions
asked 2025-01-10T05:55:02.9966667+00:00
dheeraj awale 1 Reputation point
commented 2025-01-27T03:32:47.8166667+00:00
Laxman Reddy Revuri 1,755 Reputation points Microsoft Vendor
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,238 questions
asked 2025-01-23T18:48:34.5966667+00:00
Noah Aas 545 Reputation points
edited a comment 2025-01-26T23:49:02.4633333+00:00
SurferOnWww 3,811 Reputation points
0 answers

how to zoom in&out and keep picture aspect ratio?

hi I have a winform app to display a pdf file into a picturebox control. When the user presses the left mouse button and moves the mouse until the mouse is released, a line is drawn. The start and end positions of each line are stored in a list. I want…

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,238 questions
asked 2025-01-26T04:42:34.29+00:00
Farshad Valizade 501 Reputation points
commented 2025-01-26T23:04:17.8933333+00:00
Viorel 119.2K Reputation points
2 answers

System.IO.Ports only availble on windows, but im using windows - .NET6

So i'm trying to read arduino serial from c#, but it shows me the folowing exeption when i try to open the port: System.PlatformNotSupportedException: 'System.IO.Ports is currently only supported on Windows I am currently using windows 11. Also i tried…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,067 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,238 questions
asked 2024-03-17T16:58:29.7233333+00:00
Borda Ákos 20 Reputation points
answered 2025-01-26T11:44:42.4566667+00:00
VC 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,818 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,238 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,547 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
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,920 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,238 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,547 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,125 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,238 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