10,192 questions with C#-related tags

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

How to cancel DeviceDiscoverer.DiscoverBluetoothDevices()?

I used DeviceDiscoverer.DiscoverBluetoothDevices(new DiscoveryTime(10)) to discover nearby Blueooth devices. Does Microsoft provide API to cancel it? public override void RunThread(object obj) { List<Device> devices =…

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,192 questions
asked 2024-04-10T09:27:53.2433333+00:00
longevity uyl 285 Reputation points
accepted 2024-04-12T05:33:10.36+00:00
longevity uyl 285 Reputation points
2 answers

Sending an Email on behalf on a user from another tenant

Hi Team, I have an Azure Application that I have registered. I have invited an external user to my Azure tenant (accepted). How do I use Oauth2.0 to send an email on behalf of that user, and possibly read email in the users account ? Can…

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,192 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,359 questions
asked 2022-08-29T18:41:26.617+00:00
James Inger 11 Reputation points
commented 2024-04-11T22:16:36.64+00:00
Adz 0 Reputation points
1 answer

In blazor Web app .net 8 i am using global auto render mode and using the oidc authentication of azure but after authenticatin my menus are gone cant see the links to navigate between pages in my applicatin.

I have Blazor web app in .Net 8 and I am using the OIDC connect flow to authenticate user from azure Entra Id but after authentication I am fetching groups from azure and on behalf of group policy I am showing and hiding the menus in my application but…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,133 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,373 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,192 questions
asked 2024-04-10T10:22:05.2+00:00
Kuldeep Y 36 Reputation points
edited a comment 2024-04-11T20:05:15.66+00:00
Bruce (SqlWork.com) 54,711 Reputation points
1 answer

System.ObjectDisposedException: 'Cannot access a disposed object. ObjectDisposed_ObjectName_Name', al momento de guardar mi lista de imagenes

My View in vue.js sends me the image arrangement to my api, which I want to save in a folder asynchronously and when I do the second round in my foreach to the second image it gives me the error. foreach (var imagen in imagenes) { ImagenesProducto…

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,192 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.
292 questions
asked 2024-04-09T19:43:43.2266667+00:00
Andrea Evelyn Mejia Rubio 0 Reputation points
commented 2024-04-11T13:38:53.01+00:00
Michael Taylor 47,626 Reputation points
0 answers

Error creating an Asp.Net MVC project with Microsoft Identity

Using VS 2022, I created a sample Asp.Net MVC project with Microsoft Identity (.net 4.8) and toward the end of the setup it wanted to configure the Microsoft identity platform. This step fails with the following error message below: Errordotnet tool…

Microsoft Identity Manager
Microsoft Identity Manager
A family of Microsoft products that manage a user's digital identity using identity synchronization, certificate management, and user provisioning.
605 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,240 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,192 questions
asked 2022-01-13T17:28:43.613+00:00
moondaddy 911 Reputation points
commented 2024-04-11T10:56:12.7533333+00:00
Martin Bach 0 Reputation points
1 answer

File.Exists and File.Copy not working properly when the disk is full

Hi! First of all, code for reference: if (!File.Exists(firstFile)) { File.Copy(secondFile, firstFile); } I'm having a problem while trying to copy a file using the File.Copy(string, string) method overload. It should throw an IOException('The file…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,337 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,192 questions
asked 2024-04-10T18:02:43.09+00:00
Bruno Ferrari 0 Reputation points
edited a comment 2024-04-11T10:31:10.28+00:00
Viorel 111.7K Reputation points
3 answers One of the answers was accepted by the question author.

How to cancel the "print preview" option in the printer preferences by coding?

I want to cancel the "print preview" option in the printer preferences by coding, maybe can use c++ windows api or C#. Then how to do it ? Thank you !

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,411 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,192 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,516 questions
asked 2024-04-10T04:00:43.3266667+00:00
szmm 25 Reputation points
commented 2024-04-11T06:41:00.6566667+00:00
Castorix31 81,446 Reputation points
1 answer

UWP Designer not showing in Windows 10 22h2

I am using Windows 10 22h2 (19045.4170) and have the latest Windows 11 SDK (22621.0) and Windows 10 SDK (20348.0). In Visual Studio (UWP Project), my target version is Windows 10 version 2104, but I am unable to view the designer and it tells me to…

Universal Windows Platform (UWP)
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,570 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,192 questions
asked 2024-04-08T12:41:37.9933333+00:00
Emmanuel James 20 Reputation points
commented 2024-04-11T01:56:44.6466667+00:00
Tianyu Sun-MSFT 27,106 Reputation points Microsoft Vendor
1 answer

How to fix the error that occurs when executing the GenerateTemporaryTargetAssembly task

When creating an sdk project with wpf elements, the error Could not copy the file ProjectName.csproj.nuget.dgspec.json occurs when building on the server. I see that the files csproj.nuget.g.props and nuget.g.targets are created and copied, but the file…

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,570 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.
720 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,192 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,795 questions
asked 2023-09-22T15:39:23.6633333+00:00
Danila 25 Reputation points
commented 2024-04-10T21:46:54.18+00:00
Suchy, Joe 0 Reputation points
1 answer One of the answers was accepted by the question author.

How to Count Item Occurrence Between Each Hour for a Given Range of DateTime

I will do my best to not confuse anyone, I want to get a count of the occurrences per hour. Example: between 2:00 to 3:00, there are a total of 25 timestamps between 3:00 to 4:00, there are a total of 4 timestamps I have the following which gives me…

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,192 questions
asked 2024-04-10T06:36:12.0466667+00:00
muttBunch 60 Reputation points
commented 2024-04-10T18:17:22.0233333+00:00
muttBunch 60 Reputation points
2 answers One of the answers was accepted by the question author.

Why error occurs (dataset is empty)

Dear all, Why do errors occur? Dataset is empty! When copying the statements to MS SQL Server Management Studio, it works. string SelectQuery = @"select top 1 s.*, g.EngName, c.SubjectID" + " from student…

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,192 questions
asked 2024-04-06T15:18:12.07+00:00
BenTam 1,541 Reputation points
accepted 2024-04-10T14:00:29.4133333+00:00
BenTam 1,541 Reputation points
1 answer One of the answers was accepted by the question author.

Inconsistent Window Focus Behavior: Debugging vs. Running Without Debugging

In my application, I have a MainWindow that inherits from System.Windows.Window. Within this MainWindow, there's a System.Windows.Controls.Button. Clicking this button triggers the opening of a second window, also inheriting from System.Windows.Window.…

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,192 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
935 questions
asked 2024-04-06T20:02:00.2033333+00:00
Asya Yesayan 20 Reputation points
accepted 2024-04-10T11:08:24.3166667+00:00
Asya Yesayan 20 Reputation points
0 answers

Sending bounced mail to specific mail address using Microsoft Graph API in ASP.NET C#

When sending a mail if the mail gets failed/bounced, those failed/bounced back mail needs to be delivered to the specific mentioned mail address instead of from address using Microsoft Graph API in ASP.NET C#. I tried to add bounce mail address but in…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,133 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,491 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,192 questions
asked 2024-04-09T07:01:02.0066667+00:00
Pradeep VK 0 Reputation points
commented 2024-04-10T09:37:03.6766667+00:00
Tiny Wang-MSFT 1,571 Reputation points Microsoft Vendor
2 answers One of the answers was accepted by the question author.

A select question in datatable about datetime.

The datatable has a field of datetime ,the data as follow t1 2024-03-23 09:19:22 2024-03-23 09:19:59 I want to get the 2 record which t1 equal 2024-03-23 09:19 ignore second part. datatable.select("left(t1,16)='2024-03-23 09:19') ?

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,192 questions
asked 2024-03-23T01:47:18.62+00:00
Alick Wang 266 Reputation points
accepted 2024-04-10T07:11:24.9533333+00:00
Alick Wang 266 Reputation points
1 answer

C# Webview2 WebMessageReceived event not firing anymore after update of MS Edge browser and Webview2 runtime

I am developing a WinForms project using VS2022 IDE. as per our requirement I am using Webview2 to embed the browser in our WinForms. web site load properly. my requirement was if user select any data from Webview2 at runtime then I need to capture the…

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,111 questions
Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,819 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,192 questions
asked 2024-03-20T19:43:04.9433333+00:00
T.Zacks 3,986 Reputation points
edited a comment 2024-04-10T05:40:02.0833333+00:00
Jiale Xue - MSFT 30,126 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

Can I create my own Fonts?

Is there a font that simulates LED Segments, or is it possible for me to create the Fonts and use them with C#?

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,192 questions
asked 2024-04-05T20:30:29.11+00:00
TROY c 60 Reputation points
accepted 2024-04-09T15:28:12.3333333+00:00
TROY c 60 Reputation points
2 answers

How to convert outlook email (.msg) to pdf c# ?

Are there any free libraries using which I can convert outlook emails i.e. .msg files to pdf in my WPF c# app? I've tried using PDFSharp like below but the data is not showing properly at all. The email body contains tables and text and sometimes it may…

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,665 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,192 questions
asked 2023-05-09T07:35:53.6466667+00:00
don bradman 621 Reputation points
commented 2024-04-09T15:22:37.15+00:00
Redar Ismail Chicho 1 Reputation point
4 answers

Blazor - Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0

Hi, I have an issue with a Blazor page. Sometimes I receive the following error message on the browser's console view: Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 This is strange, because this error message…

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,373 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,192 questions
asked 2022-03-29T14:57:37.95+00:00
Gábor Varga 26 Reputation points
commented 2024-04-09T14:14:48.32+00:00
Rodrigo Cury 0 Reputation points
2 answers

visual studio 2022 not showing errors

I'm using visual studio 2022 with unity, and its not giving me anything relating to unity at all, and it also isn't showing me any errors either, and i'm having to flick back and forth to try and solve any problems in my code, can anyone help with this?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,570 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,192 questions
asked 2023-09-15T03:59:41.3866667+00:00
Bede Annetts 0 Reputation points
answered 2024-04-09T12:01:41.8166667+00:00
Faizy Developer 0 Reputation points
1 answer

l cannot find the Windows.Devices.Sensors Namespace.

l wish to access the Windows Ambient lights sensors on a windows forms app using C# but l cannot find the reference for system device sensors

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,819 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,337 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,192 questions
asked 2023-09-14T23:56:15.7266667+00:00
kil_dren 02 0 Reputation points
edited an answer 2024-04-09T09:53:23.5966667+00:00
Castorix31 81,446 Reputation points