Microsoft Q&A

C#

6,920 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,920 questions with C#-related tags

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

C# remove all new line and blank line

Example of Text file: test1 Test2 Test3 Test4 Expectation: I wanted to first remove all double or more blank line and replace them with a single blank line then register the number shown on the last line as a variable. Test1 Test2 Test3…

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,920 questions
asked 2020-12-02T07:08:03.227+00:00
Tub Ntxawg Yaaj 121 Reputation points
accepted 2020-12-02T16:13:56.75+00:00
Tub Ntxawg Yaaj 121 Reputation points
1 answer One of the answers was accepted by the question author.

What Is The Optimal Solution When There Is Incompatibility Between Google Chrome Driver & Google Chrome Browser

Error - " System.InvalidOperationException : session not created: This version of ChromeDriver only supports Chrome version 85 (SessionNotCreated)" Version Of Google Chrome I Am Using: Version 87.0.4280.66 (Official Build) (64-bit) …

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,920 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying a test as a means of analysis or diagnosis.
249 questions
asked 2020-11-28T09:49:16.223+00:00
O.A 41 Reputation points
commented 2020-12-02T16:02:13.75+00:00
O.A 41 Reputation points
2 answers

Read the content of zip folder

Hi All, I have a zipped folder called 'Uploadfiles.zp'. This folder contains folders like: 5.6/Proj , 5.6/PDS, 13/Proj, 13/PDS I have to read Uploadfiles.zp folder and check if the folder structure is in the expected format or not. What is the…

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,920 questions
asked 2020-12-02T07:22:37.077+00:00
Santosh Umarani 81 Reputation points
answered 2020-12-02T12:00:46.403+00:00
Karen Payne MVP 29,226 Reputation points Microsoft MVP
2 answers One of the answers was accepted by the question author.

UDP Socket wont receive data on android

I have an issue with UdpClient.Receive(ref IPEndpoint) on android devices: for some reason the same code works on PC, but android devices (or emulators) have a 50% chance to get stuck on Receive() method. It doesn't depend on networking type (wired,…

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
4,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,920 questions
asked 2020-12-01T08:10:31.997+00:00
Я есть 96 Reputation points
accepted 2020-12-02T07:05:10.393+00:00
Я есть 96 Reputation points
1 answer One of the answers was accepted by the question author.

Simple Question : How to retract value from JSON data??

Hi there, I have a JSON sample data as the shown below: {"i:0#.w|my\jeffw":{"DateTime":"/Date(1604906464292)/", "LoginName":"SHAREPOINT\system"}, …

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,920 questions
asked 2020-12-01T14:18:57.857+00:00
Will 606 Reputation points
accepted 2020-12-01T15:55:49.403+00:00
Will 606 Reputation points
0 answers

HTTP Error 500.30 - ANCM In-Process Start Failure

Hello everyone, I am struggling with this problem for almost 5 days now. Getting this error as soon as I launch my web api solution in Google Chrome. The solution is built with .NET Core 3.1 . Event Log shows: Application ... with physical…

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,920 questions
asked 2020-11-30T12:10:18.037+00:00
Saad Masood 1 Reputation point
commented 2020-12-01T09:20:41.617+00:00
Timon Yang-MSFT 9,501 Reputation points
1 answer One of the answers was accepted by the question author.

windows 2016 steps into future for half hour at 23:00 CET and then returns to normal

I have asp.net core 3.1 program with a very basic async socket receiver and a blazor webassembly frontend. Every half an hour a machine sends a report (+/- 1000 bytes) to it, which is then stored to sqlserver and to a file on disk. Al thru the day 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.
6,920 questions
Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management, data storage, applications, and communications.
1,749 questions
asked 2020-11-19T07:54:14.247+00:00
Galien, Dirk 21 Reputation points
commented 2020-12-01T07:03:51.523+00:00
Jenny Yan-MSFT 9,196 Reputation points
1 answer One of the answers was accepted by the question author.

How to get info from xaml file in C#

Hello. In my C# program I want to know how to read this file: <!-- Info.xaml --> <Credentials Username="UsernameHere" Password="PasswordHere"/> and get the Username's value and put it in a string, how can I do 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.
6,920 questions
asked 2020-12-01T01:25:52.857+00:00
A N 81 Reputation points
commented 2020-12-01T04:02:04.15+00:00
A N 81 Reputation points
1 answer

Use Microsoft CNG library to load key from KSP and use it to initiate two-way-ssl mutual authentication

I have to connect to a backend service that is secured using two way ssl. The certificate I use for this handshake resides in an HSM. I've installed the HSM providers KSP software. I'm using Microsoft's CNG library to lookup certificate generated in…

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,920 questions
asked 2020-11-17T16:57:49.983+00:00
DV 6 Reputation points
commented 2020-12-01T03:24:15.54+00:00
Jambor Yao 6 Reputation points
1 answer

Xamarin.Forms: UWP UI Binding errors that aren't real errors?

In my Xamarin.Forms app every ListView in UWP is rather slow in creating the cells, or entries, or rows, or whatever they're called. On Android and iOS the ListView scrolls as fast as you can make it go, but on UWP after a short fast scroll the list…

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,920 questions
Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
4,803 questions
asked 2020-11-26T10:34:50.107+00:00
it-neX 1 Reputation point
answered 2020-11-30T12:13:54.723+00:00
Simon Dallmair 1 Reputation point
0 answers

Can we use script-src 'self' 'unsafe-inline' in the content security policy of the .net application?

In our asp.net SharePoint application, we have used script-src 'self' 'unsafe-inline' in the content security policy as sharepoint is generating some inline javascript code dynamically at runtime. But CSP validator showed red flag for 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.
6,920 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,347 questions
asked 2020-11-27T10:44:09.65+00:00
MSUser V 1 Reputation point
commented 2020-11-30T08:33:19.533+00:00
Baker Kong-MSFT 3,761 Reputation points
4 answers One of the answers was accepted by the question author.

How do we find very first closest value from the list of values linq C#

I have the list of values. like below. I am struggling to get very first closest values from the list. How do we get this...? For example, i have the list below. list<double> data1 = {1000, 2000, 3000, 4000, 100, 350, 600, 800, 200, 300, 400,…

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,920 questions
asked 2020-11-27T04:34:11.17+00:00
Gani_tpt 1,201 Reputation points
commented 2020-11-30T07:51:16.757+00:00
Gani_tpt 1,201 Reputation points
1 answer

c# remote development from windows visual studio like c++ linux console?

Is there a way in existing VS2019 to have a dotnet c# project be compiled and debugged on a linux host from a project template in Windows like the template for " c++ linux console"? Project on windows, sources and build copied to linux…

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,920 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.
694 questions
asked 2020-11-26T19:39:57.99+00:00
mwx 21 Reputation points
answered 2020-11-30T06:36:02.89+00:00
Tianyu Sun-MSFT 12,846 Reputation points Microsoft Employee
0 answers

Under what circumstances will Utf8JsonReader.HasValueSequence be true?

I have begun working with raw value spans and sequences inside my JSON converters. I noticed that Utf8JsonReader provides a property to check to see whether the value is a sequence: HasValueSequence. When will this be set to true? I noticed that…

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,920 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,531 questions
asked 2020-11-27T22:27:08.71+00:00
TheBuzzSaw 1 Reputation point
commented 2020-11-30T02:03:37.127+00:00
TheBuzzSaw 1 Reputation point
1 answer

Console Aplication (C#) - Memory Leak

I have a program "Console Aplication" install in Windows that execute every time. Initial consume 32 MB, but grow infinitely. My program execute connection with DB oracle through provider "Oracle.ManagedDataAccess". To Diagnostics…

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,920 questions
asked 2020-11-28T21:15:25.867+00:00
RAFAEL CAÇUCI 1 Reputation point
answered 2020-11-30T01:34:56.32+00:00
Cheong00 3,416 Reputation points
1 answer

What are the recommended practices for cross-platform library development with C# 9?

What features of C# 9 could be safely used: in Xamarin (Android/iOS), in "the legacy" .NET Framework (4.8+), in "the obsoleted" .NET Standard 2.0/2.1? Unfortunately, .NET 5 is not "the only one united…

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,920 questions
.NET Standard
.NET Standard
A formal specification of .NET APIs that are available on multiple .NET implementations.
482 questions
asked 2020-11-26T14:30:42.217+00:00
TN 1 Reputation point
answered 2020-11-29T12:59:16.737+00:00
Karen Payne MVP 29,226 Reputation points Microsoft MVP
1 answer One of the answers was accepted by the question author.

How do find min value based on parameter from excel range column by column using C#

I have below data in my excel table. i am passing parameter value "9050". Here the value should search from column by column of every cell values. for example, Input value "9050", it will come near by column of…

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,920 questions
asked 2020-11-27T16:47:05.543+00:00
Gani_tpt 1,201 Reputation points
accepted 2020-11-28T14:25:37.777+00:00
Gani_tpt 1,201 Reputation points
1 answer One of the answers was accepted by the question author.

How to prevent ComImport interface function reordering?

Hi! I have strange problem while writing c# ComImport interface. Same name functions are reordered!? Example.... In C++ IDCompositionVisual function order is: STDMETHOD(SetOffsetX)(THIS_ float offsetX ) PURE STDMETHOD(SetOffsetX)(THIS_ In…

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,920 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,170 questions
.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
289 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: The period of time during which a program is being executed in a computer.
953 questions
asked 2020-11-27T10:15:43.607+00:00
vb 276 Reputation points
commented 2020-11-28T13:25:33.913+00:00
vb 276 Reputation points
4 answers One of the answers was accepted by the question author.

C# Coding Confusion01 - Derived Classes run aborting on previously working code

I’m following two MS tutorials ([https://learn.microsoft.com/en-us/dotnet/csharp/tutorials/intro-to-csharp/object-oriented-programming1]()) which use bank accounts to introduce Classes and Derived Classes. The first of the two tutorials created a single…

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,920 questions
asked 2020-11-25T16:05:25.453+00:00
Art Hansen 561 Reputation points
answered 2020-11-28T06:58:52.727+00:00
Art Hansen 561 Reputation points
5 answers One of the answers was accepted by the question author.

C# beginner: program flow not understood

I’m just starting to follow a tutorial at https://csharp.net-tutorials.com/ I’m trying to understand why the processing flow doesn’t “drop through”. In the first code set it stops after the main block despite no errors being identified by VS. The second…

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,920 questions
asked 2020-11-22T09:01:15.743+00:00
Art Hansen 561 Reputation points
commented 2020-11-28T05:49:23.53+00:00
Bonnie DeWitt 811 Reputation points