11,163 questions with C#-related tags

Sort by: Updated
0 answers

VisualState Only Changes Once in Custom Control WinUI/WASDK App

I am working with a custom control in a WinUI/WASDK App and trying to modify the Foreground or BorderBrush of some elements using the VisualStateManager. However, I am encountering an issue where the VisualState only changes once, and after that, I am…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,020 questions
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.
805 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,163 questions
asked 2025-01-05T13:07:12.5666667+00:00
Mahdi Hosseini 135 Reputation points
1 answer One of the answers was accepted by the question author.

Downloading Folders as Zip Files c#

I created a code that downloads OneDrive folders as zip folders. When the file's downloaded, I checked it was there but when I opened it, it was a displaying an error message saying, the compressed(zip) folder is invalid. Is the below code correct 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.
11,163 questions
asked 2021-06-08T06:07:23.487+00:00
Hemanth B 886 Reputation points
edited the question 2025-01-04T22:15:56.2633333+00:00
Erland Sommarskog 114.8K Reputation points MVP
0 answers

What does ntfs system file stop code in my windows 10

Hello microsoft I like your windows and I was kinda having small problem, I was playing ps2 emulator and I went to browse memory card and while I found out the secret about the browsing memory card saves where the characters become upset when I about 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.
11,163 questions
asked 2025-01-04T20:29:55.62+00:00
Omar 0 Reputation points
1 answer One of the answers was accepted by the question author.

How does the predicate works?

Hello, I am reading the following code from Microsoft Docs. The predicate has two parameters, a string and an index. We don't use an index or any int parameter in the Linq query. How does the Linq query get the index(int) parameter? From…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,020 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,163 questions
asked 2025-01-03T16:20:04.48+00:00
Shervan360 1,641 Reputation points
accepted 2025-01-04T10:19:51.85+00:00
Shervan360 1,641 Reputation points
0 answers

how to fix at Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.CodeDomDocDataAdapter.get_Provider()

IDK how to fix all that shit

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,163 questions
asked 2025-01-03T21:50:44.57+00:00
Tohar adar Peretz 0 Reputation points
0 answers

Cannot Connect Locally to when using Microsoft.CognitiveServices.Speech

Hello Everyone, I am trying to build a method that detects the language of the audio I provide it. My application translates audio but since we batch transcribe and also use a custom model, I cannot use languageIdentification. Therefore, I am trying 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.
11,163 questions
asked 2025-01-03T20:09:00.52+00:00
Michael Lanctot 0 Reputation points
2 answers One of the answers was accepted by the question author.

What is AndroidResource type under Android-Maui?

When migrating from XAMARIN to .NET MAUI, what was AndroidResource in Android Resources folder defaults to Content which doesn't look right. What is AndroidResource type when migrated to MAUI? The file properties (for *.png, *.xml files) give no option…

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,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.
11,163 questions
asked 2023-07-25T14:04:53.2633333+00:00
dg2k 1,401 Reputation points
commented 2025-01-03T12:47:09.8466667+00:00
Development Team 0 Reputation points
1 answer

Unable to publish with fulltrustprocess and Multiple instances of UWP app

UWP experts , There are three components here. Main UWP app with multiple instances supported through package manifest - C# UWP FullTrustprocess that acts as the appserviceconnection server - C# .NET 8 WAPP Package that bundles UWP app and…

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,163 questions
asked 2024-12-03T06:00:38.49+00:00
DotNET Fan 271 Reputation points
commented 2025-01-03T09:56:29.8466667+00:00
DotNET Fan 271 Reputation points
0 answers

How to fix code throwing exception : Microsoft.Data.SqlClient.SqlException: 'Login failed for user '<token-identified principal>'. The server is not currently configured to accept this token.'

Hi All, I'm encountering an issue while trying to connect to an Azure SQL Database using Microsoft Entra Authentication (formerly Azure AD). I am using DefaultAzureCredential in my .NET application to authenticate and retrieve the access token, but…

Azure SQL Database
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,245 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,163 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,119 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,713 questions
asked 2025-01-03T00:29:43.2+00:00
Krishna Basavaraj K S 0 Reputation points
commented 2025-01-03T07:47:45.8033333+00:00
krishna basavaraj savasuddi 20 Reputation points
1 answer

How to use WebView2 AddBrowserExtensionAsync in UWP?

Attempted to use webView.CoreWebView2.Profile.AddBrowserExtensionAsync(extensionPath) but received the exception "The request is not supported." It's understood that AreBrowserExtensionsEnabled must be set to True, and the property is found in…

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,163 questions
asked 2024-12-09T06:04:18.1566667+00:00
Victor Chen 106 Reputation points
commented 2025-01-03T07:28:53.03+00:00
Junjie Zhu - MSFT 19,766 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

Response status code does not indicate success: 404 (Not Found)

I get the following error while calling an api in my Blazor application: Following is the code where the error is pointing: And following is the calling api where request is made: What went wrong here? Any suggestions? Thanks, Puneet Chandiok

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,724 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.
1,643 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,163 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.
358 questions
asked 2025-01-03T04:04:52.01+00:00
Puneet Chandiok 20 Reputation points
commented 2025-01-03T06:55:32.61+00:00
SurferOnWww 3,696 Reputation points
2 answers

Unable to detected visibility of Onscreen keyboard using user32.dll

Below code is always showing on screen keyboard as visible. Even if it is closed. using System; using System.Diagnostics; using Microsoft.Win32; using System.Runtime.InteropServices; using System.Threading; namespace CSharpTesting { class Program …

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,806 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,163 questions
asked 2024-12-10T10:27:49.5466667+00:00
Shaik Rizwan 0 Reputation points
edited the question 2025-01-03T02:11:44.1833333+00:00
Roy Li - MSFT 33,506 Reputation points Microsoft Vendor
1 answer

How to do.Everytime to save the file need to move in string TargetPath = @"C:\Users\sy\Documents\test22" then if name of the file are same , file in string TargetPath = @"C:\Users\sy\Documents\test22" need to delete and paste to

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; 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.
11,163 questions
asked 2024-12-31T11:15:16.39+00:00
MIPAKTEH_1 505 Reputation points
commented 2025-01-02T15:56:01.8266667+00:00
Viorel 118.7K Reputation points
2 answers

How do I make a richTextBox have a transparent background / show the image beneath it? (C#, Windows Forms App)

Hello, as per the title, I want to make the richTextBox in my project transparent, or have a way to show the image beneath it. Whenever I try to set the backcolor to transparent, i always get "Property value is not valid" with "Control…

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,915 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,163 questions
asked 2024-12-27T06:00:17.44+00:00
dorian tester 0 Reputation points
edited the question 2025-01-02T02:52:02.77+00:00
Tianyu Sun-MSFT 32,126 Reputation points Microsoft Vendor
2 answers One of the answers was accepted by the question author.

How to share "System.Web.HttpContext.Current.Session" between ASP.NET and .NET CORE application

Dear All, I would like to share session values between ASP.NET and ASP.NET CORE application. It is working fine only when the session value is set inside "Session_Start() method in Global.asax.cs. When I try to set session value in an other action…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,724 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,555 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,163 questions
asked 2024-12-18T15:28:55.29+00:00
Marján Zoltán 20 Reputation points
edited the question 2025-01-02T02:24:00.31+00:00
Jack J Jun 24,626 Reputation points Microsoft Vendor
1 answer

Converting BinaryFormatter Binder to DataContractSerializer

How can the Binder property from BinaryFormatter be converted to work with DataContractSerializer in C#? For example, the code snippet below uses BinaryFormatter: var bf = new BinaryFormatter(); bf.Binder = new ClassXYZ(); // ClassXYZ inherited from…

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,163 questions
asked 2024-12-22T08:13:41.5066667+00:00
Deepak Rane (drane) 60 Reputation points
commented 2025-01-02T02:15:17.06+00:00
Jiale Xue - MSFT 48,441 Reputation points Microsoft Vendor
1 answer

Question: Issue Fetching Updated RAW Data from GitHub Gist Using HttpClient

Hi, I’m working on a C project where I fetch a JSON file from a GitHub Gist using HttpClient. However, even after updating the Gist, the HttpClient.GetStringAsync() method keeps returning the old data. I suspect this issue might be related 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.
11,163 questions
asked 2024-12-12T07:32:32.0366667+00:00
fatih uyanık 160 Reputation points
commented 2025-01-02T02:10:48.17+00:00
Jiale Xue - MSFT 48,441 Reputation points Microsoft Vendor
1 answer

preventing c# listview items from disappearing

I have a ListView in a form in c#. There was info about an error in the ListView implementation that causes the items to disappear the first time the mouse hovers over the ListView, and there is a solution to prevent that which works fine. However, my…

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,163 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,332 questions
asked 2024-12-10T20:26:37.2166667+00:00
genush 41 Reputation points
commented 2025-01-02T02:03:32.48+00:00
Jiale Xue - MSFT 48,441 Reputation points Microsoft Vendor
1 answer

How to Apply Multiple Filtering Criteria in a CustomObservableCollection?

Hello I am managing data in my WPF application using a CustomObservableCollection. I created a custom collection by inheriting from ObservableCollection in order to control any additional operations that might arise on the collection in the future. Now,…

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,806 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,163 questions
asked 2024-12-27T08:28:57.8266667+00:00
fatih uyanık 160 Reputation points
commented 2025-01-02T00:59:59.27+00:00
Hongrui Yu-MSFT 3,645 Reputation points Microsoft Vendor
3 answers

Remove Extra Space in String - C#

Hello, I have a CSV file as below: In the last row, I have \t\t instead of space. I wrote a method (RemoveWhiteSpaceInString) but I cannot detect extra space. Is there any differences between ' ' and \t? using System.Reflection; 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.
11,163 questions
asked 2022-10-16T15:51:43.893+00:00
Shervan360 1,641 Reputation points
answered 2025-01-01T21:11:46.68+00:00
Najmul Islam Naeem 0 Reputation points