Microsoft Q&A

.NET

13,068 questions

Microsoft Technologies based on the .NET software framework.

Browse all .NET tags

13,068 questions with .NET-related tags

Sort by: Updated
0 answers

How to access azure keyvault through on-premise API using service principal and secret?

I'm trying to figure out how to access secrets in azure keyvault using an on-premise .Net Core 3.1 API. The authentication method is to use service principal and the client secret to access key vault. I'm following this tutorial from…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,596 questions
Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
664 questions
asked 2023-02-06T10:41:44.27+00:00
Sabanovic, Maid 0 Reputation points
commented 2023-02-07T00:50:27.32+00:00
JamesTran-MSFT 26,616 Reputation points Microsoft Employee
0 answers

why invoking a multi-targeting library doesn`t work as expected?

I`m currently learning how to create multi-targeting library with dotnet. I created a multi-targeting library in .net6 and .net 7. However, when I calling the method in this library, the output doesn`t work as my expectation. excution command: in…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
638 questions
asked 2023-02-04T07:27:37.1966667+00:00
William Liu 121 Reputation points
edited a comment 2023-02-07T00:26:01.2566667+00:00
William Liu 121 Reputation points
1 answer One of the answers was accepted by the question author.

System.InvalidOperationException: 'Invalid operation. The connection is closed.'

hello All, I am getting this error when calling a small function. I am calling this function twice. Below is my code: public async Task<EmployeeInfo?> GetEmployeeByEmployeeNumber(string employeeId) { List<int> emplyoeeInfoId =…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,596 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
617 questions
asked 2023-02-06T03:09:17.0033333+00:00
Anjali Agarwal 121 Reputation points
commented 2023-02-06T23:53:49.12+00:00
Anjali Agarwal 121 Reputation points
0 answers

Xamarin.Forms Speakerphone Stop Activating Suddenly on Android 10

I have App that has been working for years on Android 10, 11, 12 to Turn On/Off SpeakerPhone for Inbound and Outbound calls, but now it works sometimes on Inbound calls but never on Outbound calls. Here is a simple BroadcastReciever and…

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
4,820 questions
asked 2023-01-17T22:27:57.81+00:00
Universal Camera 286 Reputation points
commented 2023-02-06T23:31:43.32+00:00
Universal Camera 286 Reputation points
0 answers

Xamarin.Form make OutBound Call with SpeakerPhoneOn

It use to be that AudioManager allowed to turn SpeakerPhone On and Off during InBound and OutBound Call. I have posted several question for Android 10-13 with Xamarin each of which have fallen on deaf ears. WHY? Could it'd be that Google has sabotage the…

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
4,820 questions
asked 2023-01-25T21:38:47.23+00:00
Universal Camera 286 Reputation points
commented 2023-02-06T22:48:37.0433333+00:00
Rob Caplan - MSFT 4,106 Reputation points Microsoft Employee
0 answers

How to call the server map path filename that generated randomly

This is a C# code for a Web Form page named "upload.aspx" which allows the user to upload a PDF file and store it in the server. The file uploaded must be a PDF file, and all the text boxes must be filled before submission. The file name is…

ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
410 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.
7,020 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
1,208 questions
asked 2023-02-06T17:34:11.35+00:00
Sunny 0 Reputation points
commented 2023-02-06T22:47:34.7366667+00:00
AgaveJoe 17,296 Reputation points
2 answers

RemoteCertificateNameMismatch, RemoteCertificateChainErrors with HttpClient

Hello everyone and thanks for the help in advance. I am refactoring code that previously used WebClient (now deprecated) to HttpClient. The page connects with to a device using a self-signed certificate with an internal IP address for the Uri. …

ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
617 questions
asked 2023-02-04T23:37:12.8466667+00:00
Kmcnet 221 Reputation points
answered 2023-02-06T22:47:05.3+00:00
Kmcnet 221 Reputation points
0 answers

How do I get VS Installer to transform appsetting.json file as per SlowCheetah file transformations in an .net6 desktop app?

I am working with a C# Windows Forms App .NET 6.0. We have several different environments (dev, qat, etc) and I have created SlowCheetah transform files for each of them. When I compile in the various environments, the appsettings.json file which is…

.NET Standard
.NET Standard
A formal specification of .NET APIs that are available on multiple .NET implementations.
486 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.
7,020 questions
Visual Studio Setup
Visual Studio Setup
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
703 questions
Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,329 questions
asked 2023-02-06T22:32:31.06+00:00
Terry Carnes 0 Reputation points
0 answers

Blazor Server: Cannot access a disposed object.

In a Blazor Server application, I am trying to query the database (via EF) on a timer and load data if there is an update. I am using a new dbcontext object each time so I am confused why it is trying to access something that is disposed of. Error…

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
798 questions
Entity Framework 6.0
Entity Framework 6.0
A Microsoft open-source object-database mapper for .NET.
220 questions
asked 2023-02-06T22:28:21.37+00:00
Charles Perry 0 Reputation points
0 answers

IIS 10, redirect http and www to https

I have a website with an SSL certificate for https://a.domain.com. I am using IIS 10 to host the application running asp.net. I currently have the external DNS routing correctly for http, https and www. When type in http://a.domain.com and…

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
8,245 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
1,208 questions
Internet Information Services
asked 2023-02-06T22:22:16.6466667+00:00
Pearman C 0 Reputation points
0 answers

Building docker containers from Official .NET SDK images for ARM64 does not work

Good evening, Context I am currently trying to have a Blazor application run from a Raspberry Pi. I have to create pipelines so that when the devs push their code to a GitHub repo, it is turned into a Docker image that gets pushed to Docker Hub. For now…

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
798 questions
asked 2023-02-06T21:31:23.2633333+00:00
Jean-Jacques Kujawa 0 Reputation points
edited the question 2023-02-06T21:34:40.04+00:00
Jean-Jacques Kujawa 0 Reputation points
1 answer

Process.Start does not work anymore

I have a simple code that used to work, but it does not work anymore. Process.Start("Some Website Address"); Also, the code below works: Process.Start(@"C:\Program Files\Google\Chrome\Application\chrome.exe", "Some Website…

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.
7,020 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
638 questions
asked 2023-02-06T19:26:26.12+00:00
Skysmith 46 Reputation points
commented 2023-02-06T21:30:17.2066667+00:00
Castorix31 65,876 Reputation points
3 answers

add one to one and one to many relationship

Hi So a little weird but im trying to add a one to one and one to many relatioship between two entites lets say i have two entities 1 is branch 2 is AppUser now a branch can have a app user as the branch admin(done through roles not the elephant in the…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,596 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
1,208 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.
8,578 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.
153 questions
asked 2023-02-06T10:14:32.9833333+00:00
Asjad Butt 61 Reputation points
edited an answer 2023-02-06T20:35:56.7966667+00:00
AgaveJoe 17,296 Reputation points
8 answers

How to convert xml to style so that browser can render html from xml when using RSS

I have downloaded a app called MessageBoard and trying to configure RSS Feed to output serialised data to browser. The result display a error message with code written in xml format. This XML file does not appear to have any style information associated…

ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
410 questions
asked 2023-01-30T01:05:53.09+00:00
peter liles 371 Reputation points
commented 2023-02-06T19:59:50.99+00:00
peter liles 371 Reputation points
0 answers

Get network category name (private/public/domain) from WPF with C# (.NET 7)

In PowerShell I can use Get-NetConnectionProfile to get the NetworkCategory (private/public/domain). How can I do this from C# from a WPF app. I can see there are some examples using NetworkInformation.GetConnectionProfiles(); but that appears to be for…

.NET Standard
.NET Standard
A formal specification of .NET APIs that are available on multiple .NET implementations.
486 questions
Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
1,943 questions
asked 2023-02-06T19:52:42.34+00:00
Andrew Jones 1 Reputation point
1 answer

Enable Hyper-V on the remote Windows Server for Android Emulator?

We have two questions about Android Development on Windows: 1. We need to enable Hyper-V on a rented Windows server (remote server) so that we can start Android Emulator on it in an accelerated way. Unfortunately, we are not successful in setting up…

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
798 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
909 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
8,245 questions
asked 2023-02-06T18:21:32.4933333+00:00
perfect code 181 Reputation points
commented 2023-02-06T19:29:07.95+00:00
perfect code 181 Reputation points
1 answer One of the answers was accepted by the question author.

What is the limit of int?

Hi all. Looks like there's something I don't know... Net SDK 6.0.405, ASP Net Core 6.0.13. But what is the real limit? https://learn.microsoft.com/ru-ru/dotnet/csharp/language-reference/builtin-types/integral-numeric-types I use: int sqr = number *…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
638 questions
asked 2023-02-05T13:04:26.79+00:00
Scratchy Fo 0 Reputation points
accepted 2023-02-06T19:21:26.0333333+00:00
Scratchy Fo 0 Reputation points
0 answers

C# AsyncWaitHandle.WaitOne - Socket

Hello, Why doesn't the connection attempt wait 15 seconds? How can I achieve that the client gets up to 15 seconds for a connection? Socket or TcpClient. Thanks for your help! //Create IP address and port number; System.Net.IPAddress ip =…

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.
7,020 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
638 questions
asked 2023-02-06T18:16:22.42+00:00
Markus Freitag 2,961 Reputation points
1 answer

Max size of System.IO.MemoryStream

Im trying to fetch a .bak file of 3GB size and upload to my blob storage using the SSH.NET package. I get an System.IO.IOException: stream was too long error! I cant find the max size of handeled streams for the System.IO.MemoryStream anywhere. Do…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,596 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
1,419 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
2,612 questions
asked 2023-02-02T10:46:56.6733333+00:00
August Asheim Birkeland 20 Reputation points
commented 2023-02-06T17:45:55.14+00:00
SaiKishor-MSFT 15,096 Reputation points Microsoft Employee
0 answers

EF Core 7 not using my compound keys and throws error

Banging my head on this one. I'm trying to upgrade to Entity Framework Core 7. My class has a YearTerm and a CourseId. I can't get EF to use my key annotations or fluent API to identify my keys. I've tried the line below as in the Microsoft documents.…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
426 questions
asked 2023-02-06T17:32:43.0366667+00:00
Chris 0 Reputation points