Tag: asp.net-core-mvc

63 votes
3 answers
1.3K views
Identity Server 4/nativescript Hangs

I have the following client: new Client { ClientId = "nativeapptest", ClientName = "Native App Test",

avatar
Charis
0 1 0 9
asked 07 September, 2021
64 votes
5 answers
1.8K views
How to return a specific status code and no contents from Controller?

I want the example controller below to return a status code 418 with no contents. Setting the status code is e

avatar
Wei
0 1 0 9
asked 07 September, 2021
62 votes
10 answers
1.9K views
How do I access Configuration in any class in ASP.NET Core?

I have gone through configuration documentation on ASP.NET core. Documentation says you can access configurati

avatar
Eddie
0 1 0 9
asked 07 September, 2021
56 votes
13 answers
2.7K views
.NET Core MVC Page Not Refreshing After Changes

I'm building a .NET Core MVC on the latest version 2.2. I have a problem when I make changes to the CSHTM

avatar
Virgil
0 1 0 9
asked 07 September, 2021
67 votes
17 answers
2.9K views
Publish to IIS, setting Environment Variable

Reading these two questions/answers I was able to run an Asp.net 5 app on IIS 8.5 server. Asp.net vNext early

avatar
Tana
0 1 0 9
asked 07 September, 2021
59 votes
6 answers
1.1K views
Select Tag Helper in ASP.NET Core MVC

I need some help with the select tag helper in ASP.NET Core. I have a list of employees that I'm trying

avatar
Karolyn
0 1 0 9
asked 07 September, 2021
55 votes
15 answers
430 views
Getting value from appsettings.json in .net core

Not sure what am I missing here but I am not able to get the values from my appsettings.json in my .net core a

avatar
Solomon
0 1 0 9
asked 07 September, 2021
60 votes
14 answers
2.1K views
How to get the Development/Staging/production Hosting Environment in ConfigureServices

How do I get the Development/Staging/production Hosting Environment in the ConfigureServices method in Startup

avatar
Serina
0 1 0 9
asked 07 September, 2021
60 votes
16 answers
2.5K views
ASP.NET Core Get Json Array using IConfiguration

In appsettings.json { "MyArray": [ "str1", "str2", "str3" ] } In

avatar
Margo
0 1 0 9
asked 07 September, 2021
47 votes
12 answers
3K views
ASP.NET Core form POST results in a HTTP 415 Unsupported Media Type response

Sending a form POST HTTP request (Content-Type: application/x-www-form-urlencoded) to the below controller res

avatar
Daniel
0 1 0 9
asked 07 September, 2021
66 votes
9 answers
2K views
How to return HTTP 500 from ASP.NET Core RC2 Web Api?

Back in RC1, I would do this: [HttpPost] public IActionResult Post([FromBody]string something) { try{

avatar
Roger
0 1 0 9
asked 07 September, 2021
55 votes
17 answers
2.8K views
How do I get client IP address in ASP.NET CORE?

Can you please let me know how to get client IP address in ASP.NET when using MVC 6. Request.ServerVariables["

avatar
Majorie
0 1 0 9
asked 07 September, 2021
61 votes
23 answers
2.9K views
ASP.NET Core Dependency Injection error: Unable to resolve service for type while attempting to activate

I created an .NET Core MVC application and use Dependency Injection and Repository Pattern to inject a reposit

avatar
Trudy
0 1 0 9
asked 07 September, 2021
63 votes
30 answers
2.1K views
How to register multiple implementations of the same interface in Asp.Net Core?

I have services that are derived from the same interface. public interface IService { } public class ServiceA

avatar
Kurtis
0 1 0 9
asked 07 September, 2021
59 votes
8 answers
1.3K views
Resolving instances with ASP.NET Core DI from within ConfigureServices

How do I manually resolve a type using the ASP.NET Core MVC built-in dependency injection framework? Setting

avatar
Shanita
0 1 0 9
asked 07 September, 2021
60 votes
15 answers
2.8K views
How do you create a custom AuthorizeAttribute in ASP.NET Core?

I'm trying to make a custom authorization attribute in ASP.NET Core. In previous versions it was possibl

avatar
Louetta
0 1 0 9
asked 07 September, 2021