Questions tagged [asp.net-core-1.1]

Use this tag for questions specifically related to ASP.NET Core 1.1, in addition to using the 'ASP.NET Core' tag.

See the tag asp.net-core for more information or What's new in ASP.NET Core 1.1?

298 questions
59
votes
7 answers

How do I get current user in .NET Core Web API (from JWT Token)

After a lot of struggling (and a lot of tuturials, guides, etc) I managed to setup a small .NET Core REST Web API with an Auth Controller issuing JWT tokens when stored username and password are valid. The token stores the user id as sub claim. I…
monty
  • 5,629
  • 11
  • 44
  • 74
46
votes
5 answers

connection string for sqlserver in Docker container

I'm using Visual Studio 2017 for mac with dotnet Core and EF Core. After setting up the mssql image in Docker container , I was trying to add the connection string but throwing connection error. I tried with different options such as ip address ,…
user2695433
  • 1,553
  • 4
  • 18
  • 42
37
votes
11 answers

Error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

I'm trying to upgrade the following template project to ASP.NET Core 1.1: https://github.com/wilanbigay/aspnet-core-aurelia-typescript-starter After running dotnet migrate the project.json file has been dropped in favour of the new csproj…
Chris Nevill
  • 5,076
  • 10
  • 39
  • 72
33
votes
3 answers

Entity Framework Core Using multiple DbContexts

I'm having a problem that when I try to access a field in my PartsDbContext I get the following error: System.Data.SqlClient.SqlException: 'Invalid object name 'fieldName'' It seems that this is because I'm trying to make my PartsDbContext use…
Joe Higley
  • 1,250
  • 2
  • 12
  • 30
15
votes
11 answers

ASP.NET Core Scaffolding does not work in VS 2017

I have a beginner ASP.NET Core project in Visual Studio 2017, and I am at the scaffolding step of the HelloWorld. The Scaffolding does not work, I tested on a first computer, then at a second one... when I try to generate a controller with views ,…
15
votes
3 answers

How to change VS 2017 RC .csproj project's target framework (from core to classic)?

How to change target framework with VS 2017 RC in new core asp "csproj" projects? I mean to change after project was created. There are no project.json file which was used for that in VS 2015. In project properties in targets "pull down" there are…
14
votes
2 answers

How to mock IOptionsSnapshot instance for testing

I have class AbClass that get with asp.net core built-in DI instance of IOptionsSnapshot (dynamic configuration). now I want to test this class. I'm trying to instantiate AbClass class in test class, but I have no idea how can I…
arielorvits
  • 4,013
  • 4
  • 29
  • 52
14
votes
2 answers

ASP.NET Core 1.1 compiling with C# dynamic Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'

I'm using Visual Studio 2017 RC and started a new ASP.NET Core project targeting the full .NET Framework. This line of code will not compile. dynamic handler = _container.GetService(handlerType); if (handler == null) _logger.LogError("Can't find…
SimonGates
  • 5,623
  • 3
  • 35
  • 50
13
votes
3 answers

Asp.Net core (Full .Net framework) vs Asp.Net core (.Net Core) Performance

I find that one of the key benefit of Asp.Net core is multi fold performance improvement (requests per second) compared to traditional Asp.Net. I find many bench mark sites talks about Asp.Net core performance, but I'm not sure if the performance…
12
votes
4 answers

How to POST via a link in ASP.NET Core

I try to POST to the SetLanguage action via a link, but not sure how to finalize the following code:
serge
  • 9,891
  • 17
  • 84
  • 142
12
votes
2 answers

.net core add Web Reference

I have two Web Project. First was created about 2-3 weeks ago and Second today. I want to add Web Reference to the second web project. First old Project Solution View Second new Project Solution View In new Project I can't find how to add Web…
12
votes
7 answers

'IServiceCollection' does not contain a definition for 'AddSession'

I am getting an error while adding 'AddSession' in ASP.Net Core 1.1 using VS2017. 'IServiceCollection' does not contain a definition for 'AddSession' and no extension method 'AddSession' accepting a first argument of type 'IServiceCollection' could…
11
votes
2 answers

Crazy Deep Path Length in .Net Core 1.1

Has anyone seen a problem in .NET Core 1.1 where beneath the netcoreapp1.1\publish folder they end up with a bin folder that seems to loop on itself and eventually causes a path too long message to appear in Windows. Trying to delete this folder in…
Michael Edwards
  • 5,680
  • 3
  • 37
  • 70
10
votes
2 answers

Bad Request - Invalid Hostname when accessing localhost Web API or Web App from across LAN

I have an ASP .Net Core 1.1 Web API and Web App running on my localhost from Visual Studio 2017 on Windows 10. When I run the projects, the API runs on http://localhost:50082/api/ and the web app on http://localhost:60856/ However, if others on the…
Fabricio Rodriguez
  • 2,759
  • 5
  • 33
  • 67
9
votes
5 answers

Add Angular 4 to an ASP.NETCore Project

I want to utilize Angular 4 in my ASP.NetCore 1.1 project, within Visual Studio 2017 (read as: *.csproj file) Previously with ASP.NET Core 1.0 and Visual Studio 2015, you could simply add AngularJS (1.x.x) into the project.json as a dependency and…
Adam Vincent
  • 2,510
  • 10
  • 33
1
2 3
19 20