Category "c++sharp"

Move object in Unity 2D

I have made this script to move my player with no physics involved: using System.Collections; using System.Collections.Generic; using UnityEngine;

How to correctly update database when users session expires for ASP.NET web application using the new .NET 6 format?

When a users session expires I want to update the database to switch their status to offline but I cannot find the right way to do this as I know that they can

C# Function Overloading in the New .NET 6 Console Template is Not Working

I am getting errors trying to overload the function Print(object) in the new .NET 6 C# console app template (top-level statements). void Print(object obj) =>

Custom authentication with two ADs in ASP.NET Core

I have an ASP.NET Core 5 app that uses the Identity framework on a Windows server. When the user clicks Submit on the Login page, it needs to Authenticate their

Unable to load DLL 'CpuMathNative' on published website

I just deployed my ASP.net website which uses ML.net on a free web host called Somee. Before deploying the solution, everything was working fine and all was pub

How to control and secure blazor spa pwa app?

I have pwa blazor .NET 5 app hosted on github. People use this app at work, installed through chrome or firefox or safari on devices. It works offline and updat

Mongo Authentication failed after docker-compose up

I'm trying to automate my local dev environment with a mongo docker instance. If I up the image with no users or auth, I can connect fine but when I try to crea

Exposing hot observables from class

When composing hot observables in a class using Observable.Create, I will follow the pattern of creating a lazily evaluated field which calls a private IObserva

Comparing two objects with == operator

I have this code that checks the references of two variables, I came across this case which is a bit confusing : string first = "10"; object second = 10.ToStrin

Entity Framework Core - Relationship between owned child and another chained owned child

I am stuck with Problem, that I am trying to solve the right way. I have multiple one-to-many 'owning' relationships. But I have a duplicate relationship betwee

C# - WCV using class from .net core project

I have some problem with my project, i'm making application in .net core but i also need to create api, i want to make "wcf service" and now i can't use class f

EmguCV never open ".jpg" file but open only ".tif" files..Why?

I am using EmguCV in Visual Studio 2022 and I am simple trying to read and open my image but it only opens .tif image files not .jpg or any other file... When I

WPF - Cannot change a GUI property inside the OnChanged method (fired from FileSystemWatcher)

I want to change a GUI property in the OnChanged method... (in actuality im trying to set an image source.. but used a button here for simplicity). This is cal

Is there a way to list down only the custom dotnet templates installed?

dotnet new --list lists all the built-in and custom templates installed. But I want to list only the custom templates that I have created and installed. Is ther

LDAP Query not returning all queried attributes

Is there any reason why a LDAP query does not return all attributes passed in the request? My request looks like this: // assembling the attribute list var ldap

How to open SQLite DB created by one Xamarin Android app in another app?

I have a Xamarin Android app which creates SQLite DB. After reinstaling this app I am not able open the DB with a new version of the app. For the testing purpos

How to select multiple elements into array in Linq query?

Net core application. I have below query in my application var result = sourceProposal.Quotes .Where(x=>x.QuotationId == sourceQuoteId) .FirstO

IQueryable Result set not getting correct data

I have an object Student, which has a navigation property to Class: public class Student { public virtual List<Class> Classes {get; set;} } public cla

Cannot find type System.Windows.DependencyObject in module WindowsBase.dll

I'm using WinUI 3. I used the Project Reunion 0.5 (Blank App WinUI 3 in Desktop). I removed the x86 and arm64 architecture. As soon as I add the Microsoft.Ident

"Top-level statements must precede namespace and type declarations"

So I haven't been coding for long so I'm not so experienced, I recently ran into a problem on replit.com where the console would print out: error CS8803: Top-le