Category "c++sharp"

Deserializing JSON response without creating a class

From the result of an API call I have a large amount of JSON to process. I currently have this Object convertObj = JsonConvert.DeserializeObject(responseFromS

Reasons for and against objects handling their own persistence [closed]

I am looking at different options for persistence modelling in Windows Phone using Isolated Storage. One of the ideas I have come up with was

Decrypt ".AspNetCore.Session" cookie in ASP.NET Core

In Asp.Net core, a cookie is created when you configure your app to app.UseSession(). By default the cookie is called ".AspNetCore.Session". Its value identifi

C# UDP Broadcast and receive example

Problem: I am trying to bind a udp socket on a specific address. I will broadcast out a message. That same socket will need to be able to receive messages. Cur

Converter of System.Drawing.Point' to 'System.Windows.Point

I am trying to draw few entities in WPF. My collection contains System.Drawing.Rectangle objects, When I try to access the location of those objects in WPF XAML

Issue: No 'Access-Control-Allow-Origin' header is present on the requested resource

My problem is that I can't access to GET method from my Angular app because of the issue: Access to XMLHttpRequest at 'https://localhost:44337...' from origin '

How to access C# class from Javascript

I have a class named book in C#. In an ASPX page (which has access to book class), I have an iframe element. I want to use Javascript from the page in the ifram

How to access C# class from Javascript

I have a class named book in C#. In an ASPX page (which has access to book class), I have an iframe element. I want to use Javascript from the page in the ifram

Add Dropdown Validation to an entire Excel Column using OpenXML

In Excel, I am able to add validation rules to a range of cells and limit the accepted input to a list of values displayed in a dropdown. This is done using the

The type initializer for 'System.Data.Entity.Migrations.DbMigrationsConfiguration`1' threw an exception

I have ASP.Net MVC site. Technology Stack ASP.Net 4.6 C#.Net EF 6 MySQL -Database While I am trying to generate the database using Nuget command:- Enable-Mi

Artificial Bee Colony library [closed]

I'm working on the implementation of Artificial Bee Colony algorithm in optimization of fuzzy c-means clustering. Can anyone provide a link fo

how to access a ref or out parameter from Parallel.For or Parallel.ForEach lambda expression

Consider my following (simplified) code: public double ComputeSum(List<double> numbers, ref double threshold, Object thresholdLock) { double sum = 0;

using (?s) Regex options in Visual Studio Code

I am used to writing regular expressions that support multiple options to specify case sensitivity, white space ignoring, meaning of . etc... In C#, these optio

How to read request body in an asp.net core webapi controller?

I'm trying to read the request body in the OnActionExecuting method, but I always get null for the body. var request = context.HttpContext.Request; var stream =

Receiving access denied error from Visual Studio when trying to change target framework

The error reads, TargetFrameworkMoniker: An error occurred saving the project file 'yadayada.csproj'. Access is denied. I'm trying to switch from .net 3

Element was null when I user page object pattern

I'm new to mobile automation, and I'm facing a problem with page object pattern. When I try to find element with FindElementById everything works, here is my cl

Clearing history while debugging azure durable functions

Durable functions keep a state in storage, this is what makes them work, but it is very troublesome while debugging and developing. I have a large number of run

User defined table type with dynamic columns in SQL Server

In my .NET (C#) win application, I import an Excel file that contains multiple columns of varying numbers. So, I store the data in my datatable in code and I ne

System.MissingMethodException: Method not found: 'Void Microsoft.AspNetCore.Identity.DataProtectorTokenProvider

Stil on same project where I had issue DI Registration service type .net core 3.0. Now when that is fixed I'm getting new error. Now my code looks: servic

Assignment in an if statement

I have a class Animal, and its subclass Dog. I often find myself coding the following lines: if (animal is Dog) { Dog dog = animal as Dog; dog.Name