10,423 questions with C#-related tags

Sort by: Updated
1 answer

Hi, have a "System.Reflection.TargetInvocationException Message=Exception has been thrown by the target of an invocation.

Hi, this exception is being thrown on code that earlier worked fine. It is a message posting call only, sending a phrase to a message

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,305 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,423 questions
asked 2021-01-18T18:45:07.353+00:00
Kevin A 101 Reputation points
answered 2021-01-19T01:59:36.937+00:00
Cole Xia (Shanghai Wicresoft Co,.Ltd.) 6,751 Reputation points
2 answers One of the answers was accepted by the question author.

C# from text file to XML with structure

Hello, I get a list of numbers in an array. What is the easiest way to create an XML file from this? …

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,423 questions
asked 2021-01-15T13:14:40.893+00:00
Markus Freitag 3,786 Reputation points
commented 2021-01-18T23:47:19.797+00:00
Yitzhak Khabinsky 25,211 Reputation points
3 answers

How to get past SecurityException accessing Registry?

In the Microsoft documentation for System.Console (https://learn.microsoft.com/en-us/dotnet/api/system.console?view=net-5.0#examples) there is an example related to "font linking". One part of that example is shown in the code 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.
10,423 questions
asked 2021-01-06T22:29:33.673+00:00
Nicholas Piazza 536 Reputation points
answered 2021-01-18T22:22:04.35+00:00
Karen Payne MVP 35,201 Reputation points
1 answer

Roles question for situation where a user can login as other users

I am building an application Blazor Serverside) where a user can join, get a membership (Customer) and then fill out information on various pages. The other pathway is that they hire someone to do this for them (Pro) and that someone may ask them to…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,254 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,435 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,423 questions
asked 2021-01-16T22:19:11.533+00:00
Daniel noyn 1 Reputation point
answered 2021-01-18T20:55:59.63+00:00
Duane Arnold 3,216 Reputation points
1 answer

How to Create an expression tree with Any(p => list.Contains(p))

I want to allow users to define some custom queries/business rules and use those definitions to dynamically generate a query. I found this post by Jeremy Likness that gives an idea of what I'm shooting for. However, there is one specific case that 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.
10,423 questions
asked 2021-01-18T13:30:38.433+00:00
Rodd Harris 1 Reputation point
answered 2021-01-18T20:43:16.76+00:00
Duane Arnold 3,216 Reputation points
2 answers One of the answers was accepted by the question author.

Microsoft.EntityFrameworkCore.Sqlite C# ulong (64 bit integer) could not be translated (LINQ query)

Hi! I'm testing database code migration from .NET Framework to .NET 5.last. I'm using .NET 5, Microsoft.EntityFrameworkCore.Sqlite & LINQ query. (all last varsions) Following pseudo-code fails when using correspondence C#: ulong type…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,951 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,423 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,135 questions
asked 2021-01-18T16:51:47.347+00:00
vb 276 Reputation points
commented 2021-01-18T18:32:37.883+00:00
vb 276 Reputation points
1 answer One of the answers was accepted by the question author.

MailKit Wont Authenticate when trying to send email via SMTP

I am developing an app that prompts a user to enter input to be emailed from a contact form. Unfortunately I am unable to authenticate the email address I am using (535 code). However, I have unsubscribed and resubscribed the account name and changed the…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,254 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,423 questions
asked 2021-01-11T23:51:31.593+00:00
Tyler Crane 96 Reputation points
accepted 2021-01-18T16:10:50.66+00:00
Tyler Crane 96 Reputation points
1 answer

Error when checking if a date in Access Database table

Backend database: Access (date format: yyyy-mm-dd). It returns error when I run below code. Thanks. public static bool isDateInDatabaseTableAppointment(DateTime dt) { OdbcConnection Cn = new…

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,858 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,423 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.
954 questions
asked 2021-01-16T23:27:05.027+00:00
VAer 761 Reputation points
commented 2021-01-18T14:58:49.98+00:00
VAer 761 Reputation points
2 answers

Virtual key codes not working as expected

Hello, I'm programming an application where i use virtual scan codes that i get by virtual key codes (MapVirtualKey) for automating shortcuts. I've discovered that several key codes doesn't work as expected. For example: Tested key combinations…

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,423 questions
asked 2021-01-11T21:20:22.187+00:00
youki 996 Reputation points
commented 2021-01-18T13:24:09.913+00:00
youki 996 Reputation points
2 answers

Xamarin android emulator black screen/Can`t run blank project

All in title. At the first: Hyper-v is enable, processor - amd, i dont have HAXM. What i`m tried: Set Release mode and in advanced settings enable x86 architacture. No errors in logs, i just tilted and cant start developing on Xamarin. I`m also…

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,305 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,423 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.
954 questions
asked 2021-01-17T06:59:04.363+00:00
Sna1l1 11 Reputation points
commented 2021-01-18T11:58:16.637+00:00
Ken Tucker 5,846 Reputation points
2 answers One of the answers was accepted by the question author.

Pointer to Structure (void*)

Hello I got crash object reference not set to an instance of an object while doing this : [DllImport("ntdll.dll")] public static unsafe extern NTSTATUS NtQueryInformationProcess( IntPtr ProcessHandle, …

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,423 questions
asked 2021-01-17T18:39:19.813+00:00
Arsium ***** 331 Reputation points
accepted 2021-01-18T11:38:51.82+00:00
Arsium ***** 331 Reputation points
1 answer

Windows.Media.SpeechSynthesis.SpeechSynthesizer constructor throws file not found exception

A lot of users for my UWP app are hitting System.IO.FileNotFoundException in the Windows.Media.SpeechSynthesis.SpeechSynthesizer..ctor() The code is calling the default constructor of Windows.Media.SpeechSynthesis.SpeechSynthesizer private…

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.
10,423 questions
asked 2021-01-14T17:19:02.807+00:00
ac-lap 71 Reputation points
commented 2021-01-18T08:53:12.057+00:00
Yan Gu - MSFT 2,676 Reputation points
1 answer One of the answers was accepted by the question author.

C# - LinQ query take it, save it problem

Hello, I need to read in an xml file and need to take out n elements and save them again. Sample: TakeElements(int count); Call with TakeElements(5); <SERIALS> <POS index="1" content="AAA5SUU"…

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,423 questions
asked 2021-01-15T13:22:49.06+00:00
Markus Freitag 3,786 Reputation points
accepted 2021-01-18T07:19:08.937+00:00
Markus Freitag 3,786 Reputation points
2 answers One of the answers was accepted by the question author.

C# Files older than 20 days -> delete it automatically

Hello, I have a work folder and a folder "IsDone". C:\Share\Work\ C:\Share\IsDone\ I need to delete files there without asking that are older than 20 days. How can I do this without blocking the application? I need one thread, one…

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,423 questions
asked 2021-01-15T13:30:10.627+00:00
Markus Freitag 3,786 Reputation points
accepted 2021-01-18T07:18:15.57+00:00
Markus Freitag 3,786 Reputation points
1 answer

How to connect ESPnow to C#

ESPnow is a protocol to connect one Espressif device to another over WiFi , such as ESP32 or ESP8266, WEMOS etc. the advantage is that it is not relying on local WiFi network, so no need to select a WiFi Network and register to it with a password. 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.
10,423 questions
.NET Internet of things
.NET Internet of things
.NET: Microsoft Technologies based on the .NET software framework.Internet of things: A concept that aims to extend the benefits of the regular internet, including constant connectivity, remote control ability, and data sharing, to goods in the physical world.
28 questions
asked 2021-01-13T10:50:58.357+00:00
YigalB 1 Reputation point
commented 2021-01-18T07:14:29.45+00:00
YigalB 1 Reputation point
1 answer

Can XAML “deduce” inheritance from C#?

I wonder if XAML is somehow able to "deduce" the C# inheritance. Let me explain: I have these two C# classes: public class AStyleSelector: StyleSelector { public Style aStyle { get; set; } public override Style SelectStyle(object item,…

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,692 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,423 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.
773 questions
asked 2021-01-15T20:57:59.483+00:00
answered 2021-01-18T06:58:37.927+00:00
DaisyTian-1203 11,616 Reputation points
1 answer

C#: how to write date(dateTimePicker) as criteria?

Backend database: Access Access date format: yyyy-MM-dd I am trying to match dateTimePicker format same as Access date format, but it does not recognize the way I wrote. Thanks. string sqlDelete = "DELETE FROM TableAppointment…

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,858 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,423 questions
asked 2021-01-18T01:36:25.693+00:00
VAer 761 Reputation points
answered 2021-01-18T06:57:12.537+00:00
Daniel Zhang-MSFT 9,621 Reputation points
1 answer

Converting excel macro to C#

I am creating excel VSTO , where I already have the macro to delete excel rows based on column values(if it is greater than zero)which now needs to be converted to c# , by seeing documentation on internet I have come up so far , but still three errors…

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,423 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,599 questions
asked 2021-01-17T07:36:35.72+00:00
ravi kumar 331 Reputation points
commented 2021-01-18T05:15:40.213+00:00
Timon Yang-MSFT 9,576 Reputation points
3 answers

Retrieve programmatically SharePoint Online storage space

How can I retrieve programmatically SharePoint Online allocated (purchased) storage space of the whole tenant, which is visualized "In the upper right of the page": …

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,914 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,423 questions
asked 2021-01-08T11:33:29.507+00:00
Oleksii Kolinko 6 Reputation points
commented 2021-01-18T02:11:44.107+00:00
Emily Du-MSFT 42,821 Reputation points Microsoft Vendor
3 answers One of the answers was accepted by the question author.

String connection to remote server

Hello, everyone, I have a question about how to connect a .NET application (programmed in C#) to a database (BaseX) of a SQL Server instance (ServerX) through a SQL user (Usser: UserX, Password: PasswordX) located in a remote server which can be…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,951 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,423 questions
asked 2021-01-13T10:37:20.953+00:00
Raúl Sánchez 21 Reputation points
answered 2021-01-17T17:44:36.857+00:00
Abdulhakim M. Elrhumi 351 Reputation points