Category "asp.net-core-mvc"

Visual Studio .net core tag helpers not working

Well, lets get down to it. I'm using Visual Studio 2015 and ASP.NET core tag helpers have completely stopped working, no idea why as I've not changed anything.

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 repository to my controller. However, I am getting an err

How to Uploading Base64 / byte[] Image to Azure Blob with ASP.NET Core 6 MVC using C#?

Here is my code IFormFile. public static async Task<string> UploadFileToBlobStorage(IFormFile file) { string container = "abccontainer

"No files matched the search pattern" in tfs build

I want to build my project from TFS Azure(VSTS). I have made one project which is under Asp.Net Core. I have made Build definition with Asp.Net Core Template a

The required column was not present in the results of a 'FromSql' operation

I've just starting learning MVC6 with EF7. I have a stored proc that I'd like to return a portion of the fields that are in my model. If I don't return every

.net core injecting and resolving services

I am trying my hand at .net core web api. I have created a static method for registering my controllers like this: public static class RegistrationExtensions {

Unable to resolve service for type while attempting to activate

In my ASP.NET Core application, I get the following error: InvalidOperationException: Unable to resolve service for type 'Cities.Models.IRepository' while atte

Can I move appsettings.json out of the app directory?

I want to put my appsettings.json file outside of the web folder so that I can avoid storing it in source control. How can I do this?

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["REMOTE_ADDR"] does not work.

.net core API controller does not process identity authentication and authorization

I have a .NETcore MVC project contains controller and API controllers in the same site, which uses basic identity authentication / authorization. The API contr

Decrypt ".AspNetCore.Session" cookie in ASP.NET Core

In Asp.Net core, a cookie is created when you configure your app to app.UseSession(). By default the cookie is called ".AspNetCore.Session". Its value identifi

Using resx resources in .NET Core 1.0

I am attempting to use a resource(.resx) file in an ASP.NET Core project. I had it working in rc1 using a namedResource, but can't seem to get it working in RTM

How to add project reference to ASP.NET Core 1.0 MVC project

I have a ASP.NET Core 1.0 MVC app in solution X and I have some common projects (.net 4.5.2 class libs) in solution Y. I want to reference the projects in solu

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 easy enough but then it seems like there is somethi

How to mock an IFormFile for a unit/integration test in ASP.NET Core?

I want to write tests for uploading of files in ASP.NET Core but can't seem to find a nice way to mock/instantiate an object derived from IFormFile. Any suggest

Using remote validation with ASP.NET Core

I am trying to create a remote validation as follows: [Remote("CheckValue", "Validate", ErrorMessage="Value is not valid")] public string Value { get; set; }