Questions tagged [.net]

Do NOT use for questions about .NET Core - use [.net-core] instead. The .NET framework is a software framework designed mainly for the Microsoft Windows operating system. It includes an implementation of the Base Class Library, Common Language Runtime (commonly referred to as CLR), Common Type System (commonly referred to as CTS) and Dynamic Language Runtime. It supports many programming languages, including C#, VB.NET, F# and C++/CLI.

Filter by
Sorted by
Tagged with
0 votes
0 answers
4 views

in .net core 6, if the user session has expired then needs to redirect/route to the login action method from any controller action method

I am new in .net core 6, I am trying to manage the session state, if the user session has expired then need to redirect/route to the login action method from any controller action method. I want to ...
user22619879's user avatar
1 vote
0 answers
4 views

Integrating Minio with a .NET Project using an Identity Provider

I am working on a .NET project where I need to integrate Minio as an object storage solution while using IdentityServer4 as the Identity Provider for authentication and authorization. I've been trying ...
Mohammad Ghasemi's user avatar
0 votes
0 answers
6 views

Blazor opening modals with custom ID

Can someone explain why there is a bug here in certain situations? I have a razor component created as a modal window, and the generation of its id looks like the following screen (number 1). When I ...
Dazzyl's user avatar
  • 53
0 votes
0 answers
5 views

Create a WCF Client request using ws-security and including a Saml2Assertion in C#

I've to call a wcf service using a client certificate and including into the Security header a custom Saml2Assertion that i've pre-built. The SOAP request should looks like: <soap:Envelope> &...
Tony Rametta's user avatar
1 vote
0 answers
9 views

Warning: No client method with the name 'userjoined' found in signalR

I'm trying to create a multiplayer chat web app, when a user joins a room, i need to send message to the other users that the user has joined but for some reason the message is being sent to current ...
shriram's user avatar
  • 11
0 votes
0 answers
9 views

MinIO windows with .Net

I will try to tell the whole sequence of actions: 1. I have downloaded the file minio.exe 2. I ran it using the command ".\minio.exe server C:\minio --console-address :9090" in the console ...
Araders's user avatar
0 votes
0 answers
8 views

Net all routes fixed parameter

I have a system with multi company, and on all functions need company parameter: [route("{company}/action/.... "] I like to simplyf the route declaration, is possible define in ...
Jon Tril's user avatar
0 votes
1 answer
12 views

Adding Authentication to Blazor Server-Side Rendering (SSR) - "--auth" option not recognized

I am trying to set up authentication for a Blazor Server-Side Rendering (SSR) application, but I'm encountering an issue when using the dotnet new command with the --auth option. Here's the command I'...
user3903484's user avatar
0 votes
0 answers
15 views

An instance of analyzer cannot be created System.Runtime 7.0.0.0

I'm was trying to play around with source generators in .net7 but am stuck on this error: System.Runtime, Version=7.0.0.0 - The system cannot find the file specified.. CSC : warning CS8032: An ...
JasperDaDolphin's user avatar
1 vote
0 answers
40 views

System.OutOfMemoryException" error in Visual Studio 2019

I am encountering a "System.OutOfMemoryException" error while working in Visual Studio 2019. This error message appears when I try to run my code or perform certain actions in the IDE. I ...
Abubakr Siddique's user avatar
0 votes
0 answers
44 views

ASP.NET throwing generic 500 Error in browser

I am running an ASP.NET application and my browser just sends a http 500 error on my browser. The application is hosted in IIS. It is running in "Classic" app pool. There is no information ...
user1907849's user avatar
0 votes
0 answers
22 views

In a generic class, how to create a Nullable<T> property if T is non-nullable? [duplicate]

I have the following class that can accept generally numeric or string types: public class MdSlider<TValue> where TValue: IConvertible, IEquatable<TValue> { TValue? Value { get; set; } ...
Luke Vo's user avatar
  • 18k
0 votes
2 answers
62 views

Adding and Removing Methods from an Action passed as an argument in C#"

I'm trying to add a method to an Action passed as an argument and remove it after the Action is triggered, but it seems it is creating a new value. Action testAction = () => { Console.WriteLine(&...
CDreyer's user avatar
0 votes
1 answer
14 views

Npgsql C# Update Parameterized Statement

I'm attemtping to execute the parameterized update statement in C# below. NpgsqlConnection _command = _dataSource.CreateCommand( "UPDATE \"BulkProposal\" ...
dionysus's user avatar
  • 457
0 votes
0 answers
31 views

Name of array of multidimensional arrays?

The name of an array of multidimensional arrays (or a multidimensional array of arrays) in .NET Reflection is in "reverse" order to what you would expect. For example: typeof(int[][,]).Name =...
jbz's user avatar
  • 29
2 votes
0 answers
72 views

Create extension method that can be used within an EF query?

I have a query that looks something like this. var railcars = DbContext.Railcars .Select(r => new { Number = r.RailcarNumber, Quantity = railcar.InboundQuantity -...
Jonathan Wood's user avatar
1 vote
2 answers
37 views

MissingMethodException: Cannot dynamically create an instance of type with Blazor and Dependency Injection

I'm encountering a 'MissingMethodException' MissingMethodException: Cannot dynamically create an instance of type 'Blazor.Pages.Account.Register'. Reason: No parameterless constructor defined in my ...
Snooper_A's user avatar
0 votes
0 answers
10 views

Unable to connect EntityFramework to DB2 Provider

I have been trying to migrate to another computer while also upgrading from VS2012 to VS2019... so far I have upgraded target framework from .Net v4.0 to v4.7.2. As well as EntityFramework is v6.4.4 ...
wawo's user avatar
  • 37
0 votes
0 answers
16 views

Can’t load .winmd references when building in Release Mode

I need to add a NuGet package that depends on a reference Windows.winmd. I can build the project and run normally if building with Debug. However, the problem is when I switch to build in Release mode,...
SyndRain's user avatar
  • 103
0 votes
1 answer
33 views

Why doesn't Microsoft.Extensions.ObjectPool appear to do anything?

Using Microsoft.Extensions.ObjectPool v7.0.11 and running the following statements in LINQPad v7.7.15 var pool = ObjectPool.Create<object>(); var thing = pool.Get(); pool.Return(thing); pool....
Mike's user avatar
  • 7,500
0 votes
0 answers
11 views

.Net 7 ObservableCollection not working with MAUI CollectionView

In my MAUI app I want to display grouped data in a CollectionView as described by Microsoft here. The CollectionView is bound to an ObservableCollection. This setting does not work. No item of the ...
Frank Hintsch's user avatar
0 votes
0 answers
5 views

Svcutil does not generate async methods or GetEndpointAddress for an asmx

I cannot get the svcutil to generate code like the connected services does. Cannot generate both async and sync and the getendpointAddress method svcutil.exe /out:"C:\MyDir\reference.cs" /...
developer9969's user avatar
0 votes
0 answers
5 views

Base Href not applied Angular version 13 404 not found ,bundled js not found

i have recently update my angular version from 6 to 13 Now am using the following to run my app npm version: 6.14.8 node version: v14.15.0 "@angular/cli": "~13.3.11" however am ...
snoopy's user avatar
  • 105
0 votes
0 answers
10 views

Read json-schema definition from external file throws "Could not resolve schema reference"

I'm trying to parse a json-schema file with Newtonsoft.Json.Schema library, which holds references to an external json-schema definition that I'm not able to resolve. The two schema files are saved in ...
BeNdErR's user avatar
  • 17.5k
1 vote
2 answers
18 views

MassTransit Kafka Consumer Console App fails to connect to Kafka Topic Endpoint repeatedly

I am trying to create a Kafka Consumer that consumes data from a topic, using MassTransit. As part of this, I am creating integration tests for it using Testcontainers, in particular a Kafka ...
James Whitehead's user avatar
0 votes
0 answers
26 views

How do I configure Serilog in appsettings.json to create log file in UTF-8-BOM encoding?

The default file encoding that Serilog creates is utf-8 without BOM. How do I configure Serilog in appsettings.json to create log file in UTF-8-BOM encoding? If i add "encoding": "utf-8&...
Moris's user avatar
  • 5
1 vote
1 answer
25 views

.NET MAUI Shell customisation issues (iOS)

This is almost what I would like to end up. A custom back button and a single title. The code that generates this is: <Shell.BackButtonBehavior> <BackButtonBehavior IsVisible="False&...
Charles's user avatar
  • 296
0 votes
0 answers
7 views

Implementation Shibboleth Angular\dotnet

I have a web app where the frontend is in angular and the backend is in .net this application manages the login\sign in through Auth0. I should replace auth0 and the federated authentication then, ...
Hold's user avatar
  • 11
0 votes
0 answers
16 views

Assembly missing even if I have clearly specified as a csc reference

I am trying to get a better understanding of how the csc compiler works. I created a basic program as follows: using System; class Program { public static void Main() { Console....
user32882's user avatar
  • 5,124
-1 votes
0 answers
25 views

Prevent cache identity user in EF Core 6

I implemented middleware to check the user have authority to access endpoints or not. In case the super admin change's the user activation AFTER the user already logged and has validate access token. ...
Ibrahim Venkat's user avatar
0 votes
1 answer
41 views

I want to dynamically create instance of a class and use its method . Is there a way to implement using interfaces ? I need this in .net framework 4.5

I want to dynamically create instance of a class and use its method . Is there a way to implement using interfaces ? I need this in .net framework 4.5. Suppose I pass a string which is the class name (...
Tanmoy Roy's user avatar
0 votes
1 answer
50 views

In C# does property pattern matching allocate objects behind the scenes?

Consider this simple class public class MyData { public int Count; } And this simple method that dislikes the number 10. public bool IsDataValid(MyData data) { return consumerData is not { Count:...
DachshundWithAKeyboard's user avatar
0 votes
1 answer
23 views

Does ASP.NET Core allow you to read in the ENTIRE appsettings.json in a single call into a single class?

I've been manually reading all the sections of my Configuration (e.g. appsettings.json, env vars, secrets, etc) by reading in each "section", one by one. Works great. But is it possible to ...
Pure.Krome's user avatar
  • 84.8k
0 votes
0 answers
10 views

Share the same test over test classes in xUnit

I am just curious if it is possible to share tests between classes in xUnit. Lets say we have the following: An interface IConfigurationProvider and ConfigurationProvider CachedConfigurationProvider ...
philipp's user avatar
  • 25
0 votes
0 answers
13 views

Dot Net Project Not Working in UAT server

I am having trouble with my project when it is deployed on UAT server. It works fine on localhost as well as production server but on a specific UAT server it faces issue. Whenever I login it does not ...
Karan Kapadia's user avatar
0 votes
0 answers
20 views

How to do curl request with windows authentication in dotnet7?

I create a webapi with dotnet7 application. I use AddAuthentication to support windows authentication: var builder = WebApplication.CreateBuilder(args); builder.Services.AddAuthentication(...
Jon's user avatar
  • 105
0 votes
0 answers
39 views

C# Task cancellation without reason

I need to analyze the average time for password cracking of various lengths. I'm trying to perform several calculations in parallel and then find the average time. There is a Console.WriteLine in the ...
Danshicu_play's user avatar
0 votes
2 answers
24 views

Apache Ignite .net thin client "Too many open cursors" exception

Getting the following exception from the .net thin client performing both linq and SQL queries against an ignite cache Exception : "Apache.Ignite.Core.Client.IgniteClientException: 50000: Too ...
parikshanth's user avatar
0 votes
0 answers
14 views

MAUI Window already created on specific devices

I'm getting a weird issue on my dotnet MAUI app, it works great for me, the issue doesn't run for any other phone but one person's One Plus. AppCenter screenshot I can't figure it out and I don't see ...
Benjamin Keller's user avatar
1 vote
1 answer
43 views

Sending an email using a business email with a pdf attachment fails

I'm sending an email using a business email with a PDF attachment which I generated at runtime using string data. But it says The SMTP server requires a secure connection or the client was not ...
USER0349579345's user avatar
0 votes
0 answers
14 views

Hiding the Android Keyboard in Blazor MAUI when an Input Field is Focused

I'm using Blazor MAUI for a android app and I'm using Mudblazor as a Ui library. I in the index,razor file I have a Mudnumberfiled <MudNumericField u/ref="PLUSearch" Placeholder="PLU&...
Lasitha Lankajeewa's user avatar
0 votes
1 answer
13 views

error NU5129: - At least one .targets file was found, but 'build/xyz.targets' was not

Answering my own question to help people in the future, which is encouraged. VS2022, .Net 6.0, Asp.Net - WebAPI. After a few changes to project files we're seeing this error reported in the build when ...
Jeremy Thompson's user avatar
0 votes
0 answers
3 views

How to Fix Strong name signature not valid for this assembly FastReport.dll

PLATFORM VERSION INFO Windows : 10.0.22621.0 (Win32NT) Common Language Runtime : 4.0.30319.42000 System.Deployment.dll : 4.8.9176.0 built by: NET481REL1LAST_B clr.dll ...
Eric Vo's user avatar
-1 votes
0 answers
24 views

Managed Window Service with 24 hour Timer. Any issue with calling GC.Collect?

I have a Windows service written in C# that processes data every 24 hours via a timer. There is one method that runs and spins up some threads depending on the number of servers connected, the ...
netcat's user avatar
  • 1,279
0 votes
1 answer
21 views

The constructor of an RAZOR page never gets called in my Blazor project

The constructor NOR any methods (OnGet, OnPost...) are called in my razor page. I did try even with an to test it out but neither succeeds in fire a method. Thanks in advance !! Here are my classes ...
Titos Arthur's user avatar
-3 votes
0 answers
21 views

How to deserelize this Jason list class object. not able to deserialize. Error incorrect json at position 0 [closed]

My response model [JsonObject] public class MediaInfoOutputModel { [JsonProperty(PropertyName = "buildGuid")] public Guid BuildGuid { get; set; } [JsonProperty(PropertyName = "...
Ramanjaneya Shetty's user avatar
0 votes
0 answers
14 views

.net maui animation problems on android 13

Why does it not work on Android 13 when adding animation in the .net maui project? When lowering the target version on which it runs ( in my case Android 9), the project crashes until I return it to ...
Dmitry Stamenkov's user avatar
0 votes
2 answers
37 views

How to join without foreign key constraint in Entity Framework

I have a situation where it would make a lot of sense to have a couple of generic foreign keys. That is, columns that contain the ID of another table without defining foreign key constraints. In the ...
Jonathan Wood's user avatar
-1 votes
0 answers
39 views

There is no entity type mapped to the table 'TableName' which is used in a data operation

I am currently trying to run a .net server locally and receive the following error message in Visual Studio: "There is no entity type mapped to the table 'TableName' which is used in a data ...
AppSupportGuru1995's user avatar
-3 votes
1 answer
31 views

Why can I not get the android emulator to work on the sample .net Maui project? [closed]

I'm new to .net MAUI. I am going through the create your first .NET MAUI app on Microsoft's page and I am at the part it asks you to first create the android emulator and run it but it doesn't work. ...
TrollKilla's user avatar

1
2 3 4 5
6684