Category "c++sharp"

Why is await HttpContext.SignInAsync("MyCookieAuth", claimsPrincipal); throwing No sign-in authentication handlers are registered? (Razor Page model)

I'm trying to do a simple user authentication with the following code public async Task<IActionResult> OnPostAsync() { if (!ModelState

Visual Studio 2022 Crashes when Adding SqlDataSource using any MS Access Database in ASP.NET C# Web Project

When adding a "SqlDataSource" using any version of MS Access database the app simply crashes when you "Test Connection". This happens in the designer when usin

.Net Core 'asp-append-version' interfering with CSP nonces in Umbraco 9

I have a very simple TagHelper which will add the current CSP nonce to a specified tag. This is all working fine until I start using asp-append-version along wi

How can display Picker item of firebase realtime using xamarain forms and add to firebase when select item

I want to display a picker items from firebase how can do this ? <Picker x:Name="AppointmentPatientName" Title="Patient Name" > <Picker.Ite

MongoDB .NET Driver - StartsWith & Contains with loosely typed data

I can use the following for exact matches on loosely typed data in MongoDB: var mongoClient = new MongoClient(con); IMongoDatabase mongoDatabase = mongoClient.G

Unity - How to rename Mesh via script?

I am working on a script to rename Mesh in Unity directly because every time if I rename a FBX file the mesh asset still keep the old name as last time it has b

Unable to decrypt PGP encrypted file into Stream from Azure Blob storage using C# scripting within script task of SSIS

I am trying to read the PGP encrypted file from Azure Blob Storage using SSIS package - Script Task- C# code into Stream, decrypt the file data into string and

How to get and Bind() data from dynamic view in asp.net

I wrote Create() method to create a Test and I input that data- 1)choose from dropdownlist ,for which Course I want to add this Test 2)name 3)description I have

Prevent EF from creating table from subclasses

I have 2 classes; Product and Book. Book is subclass of Product. In my DbContext there is only DbSet of Product. I'm using EF Code-First approach. when EF creat

Log HttpContext.Response.Headers on OnActionExecuted in .NET 6

I'm trying to create an attribute [LogRequest] which will log HTTP request and response with headers. Action controller [HttpGet] [Route("GetCourse")] [LogRequ

Breakpoint not hit in EF Core IEntityTypeConfiguration class on add-migration in PackageManagerConsole

I am doing some discovery in a small test project and am trying to have a breakpoint hit in the configuration definition class. public class TripExpenseComparis

ASP.NET MVC - Populate SelectList with Font-Awesome Icons

I've populated List with font-awesome strings like: private static readonly List<string> Icons = new(){ "<i class=\"fas fa-users\"></i>",

How to count the length of value array in JSON

I have a JSON below: { "value": [ { "name": "504896c031d2fcb9", "location": "North Europe", "properties": { "state": "UNKNOWN",

MissingMethodException when migrating from Ef 6.2 to 6.4.4

For a .net framework 4.8 project, when I update the EF reference from 6.2 to 6.4.4 the application throw an error System.MissingMethodException: Unable find 'V

MAUI - OnPropertyChange not updating the UI

Hi guys I’m working on a MAUI app and I have a problem with the ui not updating every after calling OnPRopertyChanged, here are the details: When calling

Blob Storage - handle files directly on it

I desire an efficient solution to iterate through large files located on blob storage in C#. I want to use the blob storage as a local storage. In my research I

What is a NullReferenceException, and how do I fix it?

I have some code and when it executes, it throws a NullReferenceException, saying: Object reference not set to an instance of an object.

Automapper. How to map custom type property of inner class (source) to string and string array?

I want to map source inner classes to string and in other case string array but in both cases they are mapped to null. I want MapNoteFromInnerSourceEntity1 to h

ASP.Net Core Email Breaks Suddenly Citing SSL Time Mismatch

After noticing that nobody has signed up for a site of mine for a week I tried signing up myself only to be greeted with an error message. Then I tried signing

Error trying modify some attributes of a database table in a controller C#

I´m trying to modify attributes using sql database and web api .Net 6 In a controller i have this method private void SetRefreshToken(RefreshToken newRefr