Quantcast
Channel: ASP.NET Core
Browsing all 9386 articles
Browse latest View live

.Net Core MVC with React and Webpack

Is there a way to have ASP .Net Core MVC with React components and Webpack? Visual studio react project teamplate is providing react app with API, but requirement is different.My requirement is need to...

View Article


Validating the entity already exist

I have an POST method to create an entity. In this table email is primary key and other columns are user information (name,surname, etc.) I have two questions, please answer both :) 1) If customer...

View Article


zh-CN resource dll is not generated when build web app in Linux server

I have been localizing the our .Net Core (2.1) MVC Project with Resource files and CookiesCultureRequestPattern. We have 3 additional languages now such as korean, Japnees and Chines.The issue is when...

View Article

Not all code Paths Return a value

How can I initialize the variable query  before try --catch statement. Please help public Comedian[] GetComedians() { try { _logger.LogInformation($"Getting all comedians"); var query = _db.Comedians...

View Article

Could static thread be stopped in Kestrel on Linux without manual abort?

public class HomeController { public static Thread Thread = new Thread(new ThreadStart(Work)); public ViewResult Index() { if(!Thread.IsAlive && DateTime.Now < new DateTime(2020,12,31))...

View Article


package manager console help needed using visual studio 2019

When I run the following command in package manage console(VS 2019). I get the following error.Add-Migration InitialMigration The name 'InitialMigration' is used by an existing migration. PM>can...

View Article

What is the difference between Icollection and IQueryable ?

HiI just confused with  which one is the best to use to list the  record fast  either Icollection or IQueryable . What is the difference between two? Please can you advise me RegardsPol 

View Article

Intellisense won't suggest asp-for Tag Helper properties

In my View Model code, asp-for correctly shows me that "LostMisspelled" is not a member of the Data Model by underlining it in red.  It also correctly accepts "Lost" and "@Model.Lost" as asp-for...

View Article


Razor intellisense not working on empty solution!

HiI've created an empty asp.net core 3.1 (vs 2019) empty solution, but my problem is that i can not use razor intellisense feature!Also i've found this link which say add...

View Article


ASP.NET core razor pages c# equivalent to php echo and die

In a model behind I want to see if a variable has what it is supposed to have.In php I can:echo $myvariable; die;In the model behind I tried:Response.Write(somevar); Response.End();And got:Severity...

View Article

Reference to type IdentityBuilder claims it is defined in...

I'm getting this error when upgraded csproj to netstandard1.2 then come NuGet package upgrade in csproj.  This csproj is a dependency DLL to the 3 WebApp csproj.Error --> Reference to type...

View Article

public async Task OnPostAsync()

I am working with some generated code, had to modify it for image upload.  And I am more used to something like this: public void OnPost() { string petid = Request.Form["petid"]; string petname =...

View Article

why id=0 when make it integer but if string it get value ?

I work on asp.net core 2.2 really when assign value to id on url as id=5it display on debugging id=0 although i write value beside id i write my URL as below  [HttpGet] [Route("GetAllFilters/{id}")]...

View Article


RazorEngine.NetCore showing error in MVC .net core project....help

Hi All I have similar issue as one of the existing thread : https://forums.asp.net/t/2164232.aspx?RazorEngine+NetCore+showing+error+in+MVC+net+core+project+helpDoes anyone have solution.

View Article

The entity type 'AllVM' requires a primary key to be defined for VM with EF Core

HiI'm trying to return multiple different non related models in one view as aggregate interface page (each one in html tab) with Entity Framework Core (Core 2.1).Holidays model: public class Holidays {...

View Article


Target Project does not match your migration assembly.Please help

In  my project , I am keeping DbContext  in a separate project from the  web app project. This is my program structure is given below. But when I give Add-Migration the following error is comingYour...

View Article

How can I add new folder created inside the project in GitHub Repository

I have added new repository in GitHub and I have added the project in to that repository. But newly created folder does not being updated in to that repository. How can I add new folder of the project...

View Article


I Have problem in ICollection ASP CORE

Good morning, I have a question about something I am trying to develop, the project is in ASP CORE 3.1 MVC. I have 2 identities one to one and the other (which is the one with problems) from one to...

View Article

Problem for using Asp.net c# and html mixing code

I tried to use below code in asp.net but there is error in html tags like and and say it could not find begin tag. but begin tag is in first if. the errors are in between line 44 to 52.@{string n...

View Article

how to overcome overload method taking 3 arguments

Hi, I'm having issue while using "PasswordSignInAsync" during login process. Error message shows CS1501 No overload for method "PasswordSignInAsync" takes 3 arguments. my login.cshtml.cs login code...

View Article
Browsing all 9386 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>