Tag: asp.net

65 votes
15 answers
2.3K views
How to unit test with ILogger in ASP.NET Core

This is my controller: public class BlogController : Controller { private IDAO<Blog> _blogDAO;

avatar
Shantay
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
65 votes
21 answers
1.8K views
The term "Add-Migration" is not recognized

I'm using this MSDN Tutorial to run in VS2015 the command PM> Add-Migration MyFirstMigration -context

avatar
Hallie
0 1 0 9
asked 07 September, 2021
54 votes
3 answers
2.5K views
How to SetBasePath in ConfigurationBuilder in Core 2.0

How can I set the base path in ConfigurationBuilder in Core 2.0. I have googled and found this question, thi

avatar
Charis
0 1 0 9
asked 07 September, 2021
62 votes
2 answers
1.4K views
InvalidOperationException: Unable to resolve service for type &apos;Microsoft.AspNetCore.Http.IHttpContextAccessor&apos;

I started to convert my asp.net core RC1 project to RC2 and faced with problem that now IHttpContextAccessordo

avatar
Kisha
0 1 0 9
asked 07 September, 2021
58 votes
12 answers
915 views
ASP.NET Core return JSON with status code

I'm looking for the correct way to return JSON with a HTTP status code in my .NET Core Web API controller

avatar
Robyn
0 1 0 9
asked 07 September, 2021
60 votes
9 answers
1.5K views
.NET Core Unit Testing - Mock IOptions<T>

I feel like I'm missing something really obvious here. I have classes that require injecting of options u

avatar
Boyd
0 1 0 9
asked 07 September, 2021
51 votes
2 answers
1.1K views
Unexpected outcome of node.js vs ASP.NET Core performance test

I am doing a quick stress test on two (kinda) hello world projects written in node.js and asp.net-core. Both o

avatar
Clarice
0 1 0 9
asked 07 September, 2021
61 votes
10 answers
2.4K views
Using &apos;UseMvc&apos; to configure MVC is not supported while using Endpoint Routing

I had an Asp.Net core 2.2 project. Recently, I changed the version from .net core 2.2 to .net core 3.0 Previ

avatar
Don
0 1 0 9
asked 07 September, 2021
66 votes
4 answers
2.7K views
What is Kestrel (vs IIS / Express)

What is the kestrel web server and how does it relate to IIS / IIS Express? I come from developing apps on II

avatar
Alba
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
59 votes
6 answers
987 views
Where are the Login and Register pages in an AspNet Core scaffolded app?

In VS 2017, I created a new ASP.NET Core Web Application. On the second page of the wizard, I chose Web Appli

avatar
Lashawna
0 1 0 9
asked 07 September, 2021
69 votes
13 answers
3.2K views
How to read values from the querystring with ASP.NET Core?

I'm building one RESTful API using ASP.NET Core MVC and I want to use querystring parameters to specify f

avatar
Benton
0 1 0 9
asked 07 September, 2021
58 votes
26 answers
1K views
tsconfig.json: Build:No inputs were found in config file

I have an ASP.NET core project and I'm getting this error when I try to build it: error TS18003: Build:N

avatar
Virgil
0 1 0 9
asked 07 September, 2021
61 votes
5 answers
2.5K views
.NET Core vs ASP.NET Core

What exactly is the difference between .NET Core and ASP.NET Core? Are they mutually exclusive? I heard ASP.N

avatar
Alba
0 1 0 9
asked 07 September, 2021
58 votes
18 answers
1.5K views
How to enable CORS in ASP.NET Core

I am trying to enable cross origin resources sharing on my ASP.NET Core Web API, but I am stuck. The EnableCor

avatar
Cortez
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
58 votes
30 answers
1K views
Entity Framework Core: DbContextOptionsBuilder does not contain a definition for &apos;usesqlserver&apos; and no extension method &apos;usesqlserver&apos;

I am new to EF core and I'm trying to get it to work with my ASP.NET Core project. I get the above error

avatar
Venice
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