Newest 'asp.net-core' Questions - Stack Overflow

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.

0
votes
0answers
12 views

Token expiration not working in identity server

I created a website using asp.net core, Identity server( as my IDP), Angular. My Problem is when I log in to my website everything is ok, but when I navigate to other routes, Website enforce me to log ...
0
votes
0answers
14 views

Unit test fails when trying to validate input object in the controller using TryValidateModel

I wrote a unit test using xUnit to test a method in my ASP.net core Web API controller. public class RegistrationsControllerTest : ControllerTestBase<RegistrationsController> { ...
0
votes
0answers
8 views

ViewComponent InvokeAsync getting error “contains generic parameters Parameter name: type”

I created a ViewComponent for datalist paging, however when I call the InvokeAsync method I'm getting this error: ArgumentException: Type MyApp.Domain.Core.Interfaces.Data.Paging.IPaginate`1[T] ...
0
votes
0answers
15 views

EF Core Database first custom model changes

What would be the proper approach to add additional field or the likes to a Model generated from DbContext-Scaffold say pubic partial class Person { custom logic not to be overriden } EF ...
1
vote
0answers
15 views

ASP Net Core - Generic Page Models

I am starting to learn programming with ASP Net Core. While spending some time with Asp Net Core Identity I wanted to implement a own Login Page for learning purposes. Unfortunately now I have some ...
0
votes
0answers
9 views

Nav-tabs content panes not linking from Razor Syntax

I created a test panel with hardcoded href="#whatever" and id="whatever" in the content-pane. It worked fine. So, I got to write code to iterate through a list of courses, and create a tab for each ...
0
votes
0answers
12 views

Is it possible to delegate the section rendering with Razor engine to the parent layout when using nested layouts?

I have a project that is written on the top of Asp.Net Core 2.2 framework and utilizes the Razor template engine to generate the views. I have the following layout "the grandfather" _Layout.cshtml &...
0
votes
0answers
20 views

KML/XML parsing giving error that “Sequence contains no elements”

So, I'm currently trying to parse specific data in a KML doc that I have, and after I correctly load the doc (checked that it was loaded correctly via debugger), it seems that it won't read into any ...
0
votes
0answers
17 views

Updating user related data return null exception in EF ASP.NET Core 2.1

Can't access ApplicationUser property BizName, as ApplicationUser is always null when trying to update the edit post method. Null Exception is @ line ApplcationUser.BusinessName; I tried var ...
0
votes
0answers
25 views

Not sure why this LINQ query is causing an “NullReferenceException: Object reference not set to an instance of an object” Error

I am getting a Null Reference Error while trying to include a table with my query using the Include() method. I thought it was because the property I was trying to include to be of the IList type so ...
0
votes
0answers
8 views

@Html.ActionLink with an id for the link not working

When I click on the edit link, I get a page not found error. I can see the url when I hover over the edit link as /editprofile/Edit/0E... but should it be /editprofile/Edit/id=0E... and that is why I ...
1
vote
1answer
20 views

NLog include EventId in log file

The ILogger in .NETCore 2.2 has a EventId parameter. public static void LogError(this ILogger logger, EventId eventId, string message, params object[] args); How can I get NLog to output this to the ...
0
votes
0answers
28 views

is OData IQueryable async?

I'm developing an OData endpoint to return a list of items from a database. I'm returning an IQueryable and letting the front end handling the querying / filtering / expanding / paging through the ...
0
votes
0answers
23 views

EF Core - Repository, Model or View Model

To start, here are my classes: public class Name { public int NameId {get;set;} public string Value {get;set;} [ForeignKey("Name_NameId")] public ICollection<PersonName> ...
0
votes
2answers
45 views

How to update one integer in a list

is there a way to update one integer in a list. Lets say I have a list with the remaining space in some boxes, and i want to update it. how could i do something like this: foreach (var itemToStore ...
0
votes
0answers
8 views

google oauth authentication using vps address

I'm using Google authentication in my .net/angular project. It works very well on localhost. However, the prod version generates a problem of connexion since my backend project is hosted on a VPS ...
0
votes
1answer
20 views

EFCore A second operation started on this context before a previous operation completed

I got this error, but im unable to determine what is the real cause, therefore im unable to fix it? "Entity Framework Core: A second operation started on this context before a previous operation ...
0
votes
0answers
13 views

How to fix this cant find xml at GAE

I learn Angular 8 with ASP.NET core and it works grate when on Localhost but when deployed to Google App Engine the books.xml file cant be found When I make Crud calls to my endpoint at GAE the GAE ...
0
votes
2answers
18 views

Using httpClient.postasync for web api calls .netcore

I am new to .netcore, I am working on web api that are running on docker container and while using postman the web api's are working really fine outputting the results. I want to make a program in ....
0
votes
0answers
17 views

Autofac multiple resolved twice components with ASP.NET MVC Core

Disclaimer: This is my first use of Autofac (I am familiar with DI,but used other container registries), so I am still reading about how to set up Autofac while following the best practices. I was ...
0
votes
0answers
8 views

Using bootstrap modal to view table cell text in razor page

I have an html table that lists the history of comments for a part. I would like the Comment column to have a "View Here" link that when clicked, opens a modal to display the comment for the entry ...
1
vote
0answers
20 views

X-Frame-Options is not set, yet Chrome complains that it is

I'm trying to load an IFrame on my website, but I'm getting the dreaded Refused to display 'url' in a frame because it set 'X-Frame-Options' to 'sameorigin'. However, when I look at the actual reponse ...
1
vote
0answers
26 views

Complex role authorization Asp.net core MVC

I have written following code to handle authorization. Providing access or no access can be achieve with authorize attribute. My question is : Is there a standard way of handling partial access where ...
0
votes
0answers
20 views

How to mock a multipart/form-data request using Moq on .NET Core?

I have a .NET Core class library for blob storage, which I use in ASP.NET Core web applications, and I want to test the controller it exposes. For reasons beyond my control, I need to test the ...
0
votes
0answers
11 views

Creation a DIP in Asp.net core architecture

I was searching for an example that implement clean architecture in asp core development, i found a good one on github. https://github.com/ardalis/CleanArchitecture And i want to know a good way to ...
0
votes
0answers
14 views

Loading a TLS certificate uploaded to the Azure portal into a Linux app service container

For some time we've had an ASP.NET Core web app running on an Azure App Service. As part of upgrading to netcoreapp2.2 we've decided to Dockerize it and run it on a Linux container, still in an app ...
0
votes
0answers
12 views

How integrated asp.net core in vuejs and cofoundry basics cms?

How to create asp.net core project with vuejs and cofoundry basic cms any one familiar on can you help me on this. Thanks
0
votes
0answers
9 views

serilog push property using multiple times

I have a serilog middleware class implemented as per this blog post https://blog.datalust.co/smart-logging-middleware-for-asp-net-core/ if i want to use LogContext.PushProperty several time to push ...
0
votes
0answers
14 views

Value cannot be null. Parameter name: stream in data seeding using csv file

I am creating a Database seeding using CSV file in asp.net core and sql server.This is a multi driven data structure. for some entity following code update the data correctly .when i create a new csv ...
1
vote
1answer
30 views

How do I get a property at index using custom validation in ASP.NET Core?

I have input fields in my Razor page which are indexed. This is to provide a unique name for post back. For example: <input asp-for="@Model.ApprovedList[i].RefNumber" class="form-control"> I ...
0
votes
1answer
16 views

How to include CSS/JS files manually for offline use when using Vue.js CLI?

I am using Vue.js CLI with AP.NET Core in a SPA. I have a need to bundle some JS/CSS locally instead of getting it from a CDN since my app may be deployed without internet access. My public/index.html ...
1
vote
1answer
35 views

model passing and asp-for attribute

I did it many times with succes... but I dont get it what I do wrong here: This is very simple app, just with one thing to calculate. HomeViewModel public class HomeViewModel { public string ...
0
votes
0answers
17 views

if the request parameter header is as applicationx-www-form-urlencoded in json format how can i read it asp.net core

I set the Request header in postman as "application/x-www-form-urlencoded", and the format of the Request parameter is Json, but I can't get the value in asp.net core, I currently get request.form....
0
votes
0answers
24 views

Is it possible to use $count without OData endpoint?

I have problem with count function in Odata. When I use https://localhost:44327/odata/Customers?$count=true its working correctly but with https://localhost:44327/Customers/Get?$count=true count is ...
0
votes
1answer
11 views

Host binding when .net core deployed as a windows service

We have a web API that we have created using .NET core 2.1. We have two servers which sit behind a netscaler load balancer. Inside these servers, we managed to install our web APIs in port 5000. Now ...
0
votes
1answer
9 views

ASP Net core ajax not recognizing passed data

I have controller method which looks like this [HttpPost] public IActionResult CreateNew(string Naslov, int KorisnikID, int GrupaID, string Tekst) { //Some code } Ajax function that is calling ...
0
votes
0answers
29 views

Use ASP.NET Core SignalR with Angular JS

i was using a SignalR with ASP.NET MVC(server) and AngularJS (client) which work fine but now my boss ask me to update singalR server to ASP.Net core, i search a lot on internet but can't find a ...
3
votes
0answers
39 views

Consolidating ASP.NET Membership, ASP.NET Identity, ASP.NET Identity Core

I am in the unfortuate position that I have inherited applications using all of the authorisation ideas from Microsoft to date. So I have: Webforms (.NET 4.6) using ASP.NET Membership MVC 5 (.NET 4.6)...
0
votes
3answers
55 views

Unable to File Upload From Angular 8 to Asp.net Core 2.2

I have asp.net core server (using .net core 2.2) that has FileUploadController which listens to post request for incoming file. [HttpPost("Upload")] // public async Task<IActionResult> Upload([...
0
votes
0answers
11 views

Unauthorized while calling Firebase shortlink api from .net core web api

Earlier I found an api from firebase which provides shortlink from dynamic link. It is working fine when I tried from postman, but when I integrated this api in my .net core project it gives me 401 ...
0
votes
1answer
20 views

Proper way to send data back to Razor model page

I'm trying to relay an error message back to the page when for example the username a client chooses is already in use by another user using Razor model pages. I'm currently using ViewData[...] from ...
0
votes
0answers
20 views

MSBuild local binary different from build sever binary

I have an Asp.Net Core application on .Net Framework. I have tried to build the binary with MSBuild locally and deploy to IIS server, everything works fine. But when I tried to build using remote ...
0
votes
1answer
27 views

Index.cshtml not found - .NET Core 2.2 Web App Deployed on Azure

I have simple .NET Core 2.2 Web App that I have deployed to Azure App Service. App contains a simple HomeController with Index Action and Index.cshtml file. When I try to browse the page it gives me ...
0
votes
1answer
41 views

How do I verify an asymmetrically signed JWT in dotnet core?

I have found examples of asymmetric signing in .NET FW and examples of symmetric signing in .NET Core, but I cannot figure out how to asymmetrically verify a JWT in .NET Core. Given a URL to a JWK ...
0
votes
2answers
20 views

How to receive data included file in asp.net core?

Which model should I use to receive a js data, included a File object and a string, from client? Or which data type should I use for File object in asp.net Core server?
0
votes
0answers
12 views

How to replace url in the response message to serve swagger UI through a custom .net core reverse proxy?

I have built a reverse proxy based on the following tutorial in .net core https://auth0.com/blog/building-a-reverse-proxy-in-dot-net-core/. This reverse proxy works well for the rest API but does not ...
1
vote
0answers
33 views

Running Multiple .NET Core 2.2 APIs Locally with IIS

This is my first time attempting to build out an API with many different separate API projects within one solution using .NET Core 2.2. I'm really having trouble configuring all of the different ...
0
votes
1answer
28 views

Angular, how to send an array of ids with an http delete and receive it on ASP.NET Core delete backend end point?

I have a service in which I would like to be able to send an array of Ids with a single http.delete. So far I have the following: ` removeLeaguePictures(leaguePics: LeaguePicture[]) { const ...
0
votes
1answer
23 views

How to set the project to .Net Core 2.2.3 automatically or manually with the updated SDK for VS2019?

I installed the latest version of VS 2019 Community Edition and .Net Core SDKs. But I cannot update the newly created project to a 2.2.3 version of .Net Core. The projects being created are ...
0
votes
1answer
21 views

SignalR messages not working when site is deployed

I am building a web site using ASP.NET Core 2.2, and SignalR. The prime use of SignalR is to send out notifications from a controller. I inject an instance of IHubContext<CampaignHub> and am ...