Questions tagged [asp.net-core]

ASP.NET Core is a lean, composable and cross-platform framework for building web and cloud applications. It is fully open source on GitHub. ASP.NET Core apps can be run on Windows with the full .NET Framework or smaller .NET Core, or on Linux and MacOS with .NET Core and Mono.

1
vote
0answers
18 views

Postman Form Data to ASP.NET Core 2.2 Controller not binding to Command with private setters

Tools Visual Studio 2017 ASP.NET Core 2.2 Postman v7.2.0 What I'm trying to do Send FormData from Postman to an ASP.NET Core controller and have the data from the request bind to to a command class ...
1
vote
0answers
32 views

How to remove a node in appsettings.json in other environments?

I have the following in the appsettings.json (.net core asp.net project): { "Serilog": { "WriteTo": [ { "Name": "File", "Args": { "path": "sample.txt" } }, { "Name": "Debug" } ] ...
0
votes
0answers
13 views

Why do I not get an exception when I try to return JSON with a self referencing loop?

I ran into an error with my ASP.NET Core (on IIS Express) where a call to a GET request would return 200 OK but then fail with no data passed. (When looking in Chrome Devtools). I would see an error ...
0
votes
0answers
17 views

.NET Core On-Premises Active Directory Authentication is Missing

I don't have much experience setting up ADFS authentication in the .NET stack so forgive my ignorance if I am missing the obvious: Using Visual Studio 2019, If I go to create a new ASP.NET Web ...
0
votes
1answer
9 views

Does EF Core have a connection pool?

The DbContext of EF Core is scoped in the ASP.NET Core services. So a new DbContext is created on each request. Does this mean that a new connection is opened on each request, including all the ...
0
votes
0answers
10 views

Specify content-type for files in multipart/form-data for Swagger

I have implemented endpoint with this signature [HttpPost("Test")] public IActionResult MyTest([Required] IFormFile pdf, [Required] IFormFile image) { // some stuff... return Ok(); } this ...
-1
votes
0answers
13 views

C# .NET Core 2.2 Web-Api 500 only on Kestrel only one endpoint

I got a Web-Api project. This project is rolled out on a kestrel as a service. Now one of all my endpoints returns straight a 500, the others work fine. And the 500 I get only on kestrel, also while ...
1
vote
0answers
25 views

.Net Core MVC - Attribute routing and building query string using custom anchor tag helper

In my .Net Core 2.1 application, I have to pass few query string parameters between pages (several pages). So I created a custom tag helper to build these URLs with required parameters to avoid coding ...
2
votes
1answer
21 views

Logging events from ASP.Net core identity with serilog

Maybe somebody has already answered similiar question, but I couldn't find it - if so I would be glad for link to it. I'm using serilog with ASP.Net core to log various events, and when it comes to ...
-1
votes
0answers
13 views

Can't reach controller from view

I'm using SPA page as a view, and trying to send a request to my controller. I have 200 code but no data from controller. I guess that there is some problems with routing or I'm requesting wrong URL's....
-1
votes
0answers
22 views

Shared data with Sql Azure

We have some crucial data, which is imported via Azure Functions from a external data provider and is now integrated in one database and codebase. But now we are starting a new codebase ( different ...
1
vote
0answers
16 views

SignalR Hub broadcasting from custom function triggered by Hub method

How can I run SignalR Hub for long running process in case like this? I want to broadcast data from async IoT Hub receiver to all clients connected to hub, but i want to have only 1 thread running and ...
0
votes
0answers
32 views

Multiple databases data access in net-core microservices architecture

I have a simple, hard question 😁 I'm writing a .net-core 2.2 web api application and I have 4 microservices that storing data in 4 databases. Now i have to implement the export method, and i don't ...
0
votes
0answers
12 views

Powershell runspace instantiate error: System.Management.Automation not found

I am trying to make some remote requests to Exchange from a .NET core api but I am having some issues and I am unable to find a solution. I created a singleton pattern so I can only have one ...
0
votes
0answers
19 views

How to host multiple application on linux

Hi Please help me hosting more than one .net core application on Linux, actually, it takes by default 5000 port no. but when I public two application same time then one is killed by default so please ...
0
votes
0answers
13 views

Execute a method after some inactivity using Rx .Net

I have a Controller Action like this: [HttpPost("Post")] public async Task Post([FromBody] UpdateDataCommand command) { await _mediator.Send(command); } It is done in .Net Core, and is using ...
2
votes
0answers
31 views

Identity does not work with facebook authorization

Like in title, I have problem with facebook and identity. I used microsoft documentation to implement identity and facebook authorization to my project. I can login with identity but when i try login ...
0
votes
0answers
31 views

Cannot resolve parameter x of constructor

I am fan of modular registration so i tend to use this extensively across all of my netcore projects. In this instance I am copying from a working example (lol written by me), something i converted ...
0
votes
0answers
9 views

jqxgrid error 404.15 trying to filter a column with the checkbox filter (the query string is too long.)

When i try to filter a column with more than 5 checkboxes checked the api returns a 404.15 The api runs on ASP.NET Core var source = { datatype: "json", ...
0
votes
1answer
26 views

What does an Anti Forgery Token check for, and it actually check for? [duplicate]

I believe after reading a few other questions that my understanding of Anti Forgery Tokens is incorrect. I have a few controller post actions that take the same model but perform different actions ...
-1
votes
2answers
32 views

How to test a automatic ModelState's custom attribute method validation for Core api controller? [duplicate]

I would like to test my controller method for a given MyModelDTO values. This is my controller Post method (simplified): [HttpPost] public ActionResult Post([FromBody] MyModelDTO itemDTO) { ...
1
vote
1answer
23 views

Azure DevOps build don't fail when coverage is below target with dotnet test

I have a build pipeline in Azure DevOps for a ASP.NET Core app, and a want use it with a criteria to approve a pull requests. steps: - script: dotnet restore displayName: 'Run command: ...
0
votes
0answers
18 views

The program 'Project.exe' has exited with code -42 (0xffffffd6)

I am trying to extend an existing aspnetZero solution with WPF(Core3). when i run the project , the debuger exit with 0 erreur , and iget on outut this message: The program '[12936] Guichet.WPF.exe'...
0
votes
0answers
9 views

How to accept and reject (Ack and Nack) messages manually?

I create a consumer base to retrieve each message from RabbitMq. I'm using easynetq to consume the messages in which the consumer is configured by advanced mode because the queue has some different ...
0
votes
0answers
33 views

Solve 404 error when hosting netcore 2.1 web api in IIS

I'm publishing .netcore 2.1 web api project in IIS but i'm getting 404 error. I can run application from Visual studio and its working with swagger. already installed netcore 2.1 runtime, restarted ...
0
votes
0answers
14 views

Exporting SSRS Report in JSON format using URL

Getting '@' as prefix in each properties while converting SSRS XML Report into JSON using C#. How can we remove unwanted '@' from every properties? As SSRS does not support it's report to be ...
0
votes
1answer
22 views

gRPC Client->Server connection failed - The server returned an invalid or unrecognized response

I have build the gRPC pair (client+Greeter Service) as MS described here and tried to run. I have received the Server log: dbug: Grpc.AspNetCore.Server.Internal.GrpcServiceBinder[1] Added gRPC ...
0
votes
1answer
16 views

Azure Devops Pipeline keeps failing NuGetCommand

As the title said, it shows me this error The nuget command failed with exit code(1) and error(NU1607: Version conflict detected for Microsoft.AspNetCore.Antiforgery. Reference the package ...
0
votes
0answers
8 views

how to handle MissingMethodException when wrong bearer token is used in ASP.NET Zero API

we use ASP ZERO to build our Azure app service, but I found a problem when use the API service, when use a wrong authentication token, the response show exception in html format. we use POSTMAN to ...
1
vote
1answer
33 views

IEnumerable Error on View with Partial Load

I am trying to create a view in my application that performs basic CRUD commands in ASP.NET Core to teach myself some new skills. I am however stuck and would appreciate some assistance please. I ...
0
votes
0answers
18 views

How do I post form data with a list of list?

I'm trying to save a list of lists, where I have a checkbox containing some options where are multiple choices. I'm getting the first list just fine, but the "children" prop always comes back as null. ...
0
votes
1answer
33 views

The connection is already in a transaction - Error on CreateTables EF Core

I want to insert a record in an existing table, using a context, and create new tables in the same transaction using a different context. The two contexts share the same connection, however when I ...
0
votes
0answers
12 views

MySql.Data doesn't work on Linux CentOS 7

I'm trying to deploy a .NET Core application on Linux CentOS 7 server. It's my first time to deploy to non Windows server but I managed to deploy a simple application (just controller with static ...
0
votes
0answers
49 views

.Net Core Redirecting Url with Question Mark

I am trying to redirect old URLs to new ones by using rewriter inside the middleware. ... // Inside configure var rewrite = new RewriteOptions().AddRedirect("oldUrl", "newUrl"); app.UseRewriter(...
1
vote
1answer
28 views

ASP.NET Core deployment methods

I am going to deploy 2 ASP.NET Core 2.2 web applications onto an IIS environment. I was wondering if there were any options in the market to facilitate automatic deployment? For my previous ...
4
votes
3answers
76 views

Why should I use User secrets only in the Development environment?

I have to save keys out of project and repository. For this, I want to use User secrets. But it is written there, Call AddUserSecrets only when the app runs in the Development environment, as ...
0
votes
1answer
10 views

ExpressiveAnnotations error message on validation

After inserting the ExpressiveAnnotations (expressive.annotations.validate.js) into my application and triggering an input to be validated the browser shows a error message (see below). I don't think ...
1
vote
1answer
18 views

Tag helper order of execution

I am writing a set of ASP.Net Core tag helpers that target (among other tags) <form> and <input> tags. My <form> tag helper defines a custom attribute, the value of which it wants to ...
0
votes
0answers
24 views

ASP.Net Core 2.2 Kubernetes Ingress

I have the following ingress.yml: apiVersion: extensions/v1beta1 kind: Ingress metadata: name: ingress namespace: default annotations: kubernetes.io/ingress.class: "nginx" nginx....
2
votes
0answers
44 views

Cors blocking saml2 workflow

The Idp authentication page is blocked by the browser: Access to XMLHttpRequest at https://login.microsoftonline.com/...' (redirected from 'https://a.server.b.com/ExternalLogin/Login?d=1560675044037')...
0
votes
1answer
58 views

c# use a function on a generic type with ViewModel

Is this possible? I am trying to avoid a lot of copying and pasting from area to area. I have a search function (I have reduced the code for simplicity). if (!String.IsNullOrEmpty(filterVM....
0
votes
2answers
19 views

send more parameters in swagger Available authorizations pop up

I am developing web API in ASP.NET Core. I am looking for a way for sending parameter beside authorization in swagger to send them in header
0
votes
1answer
44 views

Why doesn't the .Net Core / Azure Web Job example work?

I am attempting to create a web job that runs on a manual trigger (using .Net Core 2.1 and Azure SDK 3.x). I am simply copying/pasting the code from the example (Manual Trigger) to just get a working ...
1
vote
2answers
71 views

How can I create attribute to check if the user has a claim with Identity core 2.2?

I have an application written with C# on the top on ASP.NET Core 2.2 framework. I want to be able to check if a user has a claim before I allow them access to the action. I created an ...
-1
votes
0answers
9 views

Is WS-Federation in .NET Core Actually Supported?

According to this doc from Microsoft, WS-Fed is supported in .NET Core. But when looking at the tutorial information is missing (like the code base for the full working example in the link). Has ...
0
votes
1answer
41 views

How to pass DbContextOptions value while creating DbContext instance in EF Core

I'm trying to get the connection string from appSettings.json file but i can't. My startup is this: namespace YangSoft_WebAPI { public class Startup { public IConfiguration ...
0
votes
1answer
28 views

Dotnet restore inside docker container

I'm playing around with asp.net core 2.2 and docker. The project uses nuget packages from nuget.org and also from private nuget feed. The private nuget feed is accesible only in VPN connection. The ...
0
votes
1answer
31 views

ASP.NET Core authentication with JWT: 'The signature is invalid'

I want to enable authentication based on jwt claims. For some reason the token seems to be invalid, more specifically its signature seems to be the problem. I tried verifying the signature on https://...
0
votes
1answer
17 views

API request for LinkedIn user data always returns 401

I am building back-end(API) of mobile application on asp.net core. Using swagger for visualization of API calls and so on. Currently I am creating external authentications, I have some problems with ...
-1
votes
0answers
25 views

Validation of access token is not working for asp.net core 2 [on hold]

In my application using asp.net identity and for token generation use jwt. after login getting valid token which was validate in jwt.io but when I call any authorize api it always show unauthorize ...