Questions tagged [asp.net-core-1.0]

Use this tag for questions specifically related to ASP.NET Core 1.0, in addition to using the 'ASP.NET Core' tag. ASP.NET Core 1.0 was the first release of ASP.NET Core and was originally intended to be ASP.NET 5.

asp.net-core-1.0
Filter by
Sorted by
Tagged with
0 votes
1 answer
320 views

Recommend way to make a UI middleware in aspnet core 1

I am trying to make a UI middleware and wanted to know what's the recommended way to go about it. Should I do a AddMVC again in my middleware and give it a custom route or go by embedding resources. ...
Muqeet Khan's user avatar
  • 2,104
3 votes
2 answers
707 views

Publish ASP 5 application to Azure in a custom environment

In my ASP.NET 5 (core, vNext) application I have: appsettings.test.json appsettings.development.json appsettings.staging.json appsettings.production.json appsetings.cloud.json Each of these include ...
A-Sharabiani's user avatar
  • 18.6k
2 votes
0 answers
156 views

Error starting Asp.Net Core MVC app in IISExpress

I have a strange error when starting brand new ASP.NET Core MVC project. Iisespresstray is throwing this exception at each startup : System.ArgumentException: Le nom de répertoire C:\Users\...
Kirix's user avatar
  • 41
3 votes
1 answer
258 views

Read the version and other project metadata from project.json

In an ASP.NET Core ( ASP 5, ASP vNext): How can I read the version and other meta data in the project.json in my Razor views? My project.json file is something like this: { "version" : "1.0.0-*...
A-Sharabiani's user avatar
  • 18.6k
12 votes
3 answers
19k views

RemoteIpAddress is always null

var test1 = HttpContext.Features.Get<IHttpConnectionFeature>(); var test2 = HttpContext.Connection.RemoteIpAddress; When running the application locally on IISExpress, these two lines correctly ...
A-Sharabiani's user avatar
  • 18.6k
3 votes
2 answers
2k views

EF core Migrations wrong latin SQL encoding

I have a ASP.NET Core 1.0 project with EF7. When I add a migration with SQL command and latin characters, I get them replaced by "?" when updating database. Let's see an example: public partial ...
tede24's user avatar
  • 2,314
0 votes
1 answer
344 views

Which should I use: Microsoft.Extensions.Configuration OR Microsoft.Framework.ConfigurationModel

I have an ASP.NET Core app and I'm currently using IConfiguration interface from Microsoft.Extensions.Configuration. Looks like IConfiguration interface is also available through Microsoft.Framework....
Sam's user avatar
  • 28.5k
3 votes
3 answers
844 views

ASP.NET Core 1.0/MVC 6 restart application programmatically

How can I restart the current application programmatically? Basically in Startup.cs I need to load some services from assemblies which will require IIS Restart or the application to be restarted/...
user2818430's user avatar
  • 6,001
22 votes
5 answers
19k views

Configuring AutoMapper 4.2 with built in IoC in ASP.NET Core 1.0 MVC6

I am trying to figure out the proper way to configure AutoMapper in my application's Startup.cs file and then use it throughout my application. I am trying to use this documentation which somewhat ...
Blake Rivell's user avatar
  • 13.5k
-1 votes
3 answers
4k views

Tutorials for Asp.net core 1.0 and .net core 1.0 [closed]

How do I get started with Asp.net core 1.0 with .net core 1.0. Please suggest some tutorials. I want to develop and deploy on linux.
VivekDev's user avatar
  • 23.3k
4 votes
1 answer
2k views

Entity Framework Core 1.0 DbContext not scoped to http request

I understood by watching this video with Rowan Miller https://channel9.msdn.com/Series/Whats-New-with-ASPNET-5/06 (at minute 22) that the way of configuring Entity Framework Core (previously known as ...
diegosasw's user avatar
  • 14.8k
14 votes
2 answers
9k views

Does ASP.Net Core 1.0 support WebForm projects

Does ASP.Net Core 1.0 support .Net WebForm projects? Or it is an MVC only environment? Also can I create classic web services(asmx) there?
George Huang's user avatar
  • 2,523
16 votes
3 answers
10k views

Entity Framework Core 1.0 unit of work with Asp.Net Core middleware or Mvc filter

I am using EF Core 1.0 (previously known ad EF7) and ASP.NET Core 1.0 (previously known as ASP.NET 5) for a RESTful API. I'd like to have some unit of work scoped to an http request in such a way ...
diegosasw's user avatar
  • 14.8k
1 vote
2 answers
2k views

ASP.NET Core 1.0 Exception Filter Can't Make it Return 404

I have been trying to make an Exception Filter work by just simply returning a 404. Unfortunately it doesn't seem to return a 404 at all, instead it throws 500. API Controller: [HttpGet("{id}")] [...
allencoded's user avatar
  • 7,165
60 votes
5 answers
60k views

Basic Authentication in ASP.NET Core

Question How can I implement Basic Authentication with Custom Membership in an ASP.NET Core web application? Notes In MVC 5 I was using the instructions in this article which requires adding a module ...
A-Sharabiani's user avatar
  • 18.6k
4 votes
2 answers
2k views

Attribute Routing in ASP.NET Core 1.0

Do I need to configure anything to use attribute routing in an ASP.NET Core 1.0 application? The following doesn't seem to be working for me. I was expecting to hit this method when I go to localhost:...
Sam's user avatar
  • 28.5k
3 votes
4 answers
5k views

ASP.NET CORE 1.0, AppSettings from another assembly

I have an application splittet into two projects: a web application and a class library. The Startup is only in the web application: var builder = new ConfigurationBuilder() .AddJsonFile("...
Dani's user avatar
  • 987
2 votes
0 answers
182 views

Convention based approach for configuring services based on Operating System in Startup.cs

I recently created an ASP.NET service using 1.0.0-rc1-update1 on coreclr (x64). So, the service is capable of running on all supported Operating Systems; very cool! My service just exposes a simple "...
Rob Davis's user avatar
  • 1,309
0 votes
1 answer
380 views

I am creating a Table setting Maxlength = 5 for a column and its created with length = 1

I have the following table being created (by using DNX commands in EF7, now EF Core) [Table("FishGrade")] public partial class FishGrade { public FishGrade() { FishPrices = new ...
Grant Nilsson's user avatar
6 votes
2 answers
7k views

ASP.NET CORE 1.0, Impersonation

I'm writing an Intranet application. Target framework in project.json is dnx451. That's my publishing command: dnu publish --runtime dnx-clr-win-x86.1.0.0-rc1-update1 --no-source Database Connection ...
Dani's user avatar
  • 987
0 votes
1 answer
311 views

Custom TagHelpers in ASP.NET MVC6 & EF 7

Here's my codes: _ViewImport.cs @using BFcMVC @addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers" @addTagHelper "BFcMVC.TagsHelpers.TagsHelpers, BFcMVC" BFcMVC.TagsHelpers: using Microsoft.AspNet....
Y.Berthoud's user avatar
10 votes
1 answer
8k views

Return HttpStatusCode in API method

How do I return an HttpStatus code from API methods in my ASP.NET Core 1.0 if there's a problem? If the method is supposed to return a particular object type, when I try return an Http status code, I ...
Sam's user avatar
  • 28.5k
0 votes
1 answer
718 views

Implementing custom authentication provider in ASP.NET 5

I'm trying to implement my own version of JWT Bearer authentication on top of ASP.NET 5, without referring to any existing JWT token handler classes. It's my exercise to understand internal mechanism ...
kosmakoff's user avatar
  • 368
10 votes
5 answers
20k views

What does it mean for an entity type to be in "shadow state"?

In my ASP.NET Core 1.0, MVC6, EF7 web application, I'm adding a migration that adds a new related table (& corresponding model). I have the following model snapshot: [DbContext(typeof(...
David's user avatar
  • 3,067
17 votes
6 answers
15k views

OutputCache / ResponseCache VaryByParam

ResponseCache is somewhat a replacement for OutputCache; however, I would like to do server side caching as well as per parameter input. According to some answers here and here, I should be using ...
Nick De Beer's user avatar
  • 5,252
0 votes
1 answer
1k views

ASP.NET Core 1.0 Global exception handler in console application (DNX)

I'm trying to handle unhandled exceptions in asp.net 5 console application but I can't seem to catch these errors using the code believe. As soon as the exception is thrown the code breaks. Is there ...
DotnetShadow's user avatar
3 votes
4 answers
1k views

ASP.NET 5 Self-Host

I Have a project in ASP.NET 5 using self-host. PROJECT.JSON "commands": { "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000", "gen": "...
Felipe A.'s user avatar
  • 939
297 votes
24 answers
440k views

How to get the current logged in user ID in ASP.NET Core?

I've done this before with MVC5 using User.Identity.GetUserId() but that doesn't seem to work here. The User.Identity doesn't have the GetUserId() method. I am using Microsoft.AspNet.Identity.
MRainzo's user avatar
  • 3,920

1
14 15 16 17
18