Tags ".net-core" Result

.net Core Authentication

I wanted to implement forms authentication with membership in my asp.net MVC Core application. We had forms authentication setup in our previous application as below and wanted to use the same in .net core. [HttpPost] public ActionResult Login(LoginModel model, string returnUrl) { if (!this.ModelState.IsValid) { return this.View(model

it1352 0 2020-09-08

Is it possible to reference .net framework 4.7.2 class library from an ASP.NET Core MVC project?

I have an ASP.NET MVC 5 project which works well and it also references a .NET Framework 4.7.2 Class library which produces some CrystalReports. CrystalReports does not support .NET Core, so the class library will stay with full .NET Framework. Now, if I upgrade the ASP.NET MVC 5 to ASP.NET Core 2 (or 3), will I be able to reference the class libr

it1352 0 2020-08-19

Running .NET core App on .NET framework

I was reading this article: https://blogs.msdn.microsoft.com/cesardelatorre/2016/06/28/running-net-core-apps-on-multiple-frameworks-and-what-the-target-framework-monikers-tfms-are-about/ about using different monikers for .NET core app and I was wondering what is the difference between creating ConsoleApp with .NET framework 4.5.1 and creating Cons

it1352 0 2020-08-19

.NET Core Openiddict InvalidCastException

I'm using openiddict on a .net core 1.1 project. So far i was able to login through /connect/token endpoint. Suddenly, without any changes to the controller i get the following exception InvalidCastException: Unable to cast object of type 'AspNet.Security.OpenIdConnect.Primitives.OpenIdConnectRequest' to type 'OpenIddict.OpenIddictOptions

it1352 0 2020-07-02

Ajax.ActionLink Alternative - Net Core

Earlier in MVC I used @Ajax.ActionLink for Ajax call and replaced container in my layout. Now in .Net Core there is anything like AjaxHelper back then. How can I form Ajax call without writing jquery script for every menu item in my dashboard. I tried @Url.Action with anonymous Ajax parameters but that won't work. @Url.Action("Index", "User"

it1352 0 2020-09-08

App Settings .Net Core

I am trying to add an appsettings.json and followed a lot of tutorials and still can not do it. I create appsettings.json { "option1": "value1_from_json", "ConnectionStrings": { "DefaultConnection": "Server=,\\SQL2016DEV;Database=DBName;Trusted_Connection=True" }, "Logging": { "IncludeScopes": false, "LogLevel": { "Defa

it1352 0 2020-09-08

.net-core Dependency Injection

I have a Generic repository which I want to register for DI, it implements an interface IRepository. Normally I would create an instance of it like this: IRepository repo = new Repository<Order>(); However I am trying to get up to speed in .net 5 ahead of release and want to get this working with DI, I have resorted to the following : se

it1352 1 2019-05-10

NSubstitute ILogger .NET Core

I am trying to write unit tests around my exception handling so that I can verify the my logger is properly logging the exception. I am using NSubstitute as a mocking framework and Microsoft.Extensions.Logging.ILogger I have to following for my test: [Fact] public void LogsExcpetionWhenErrorOccursInCreate() { var newUser = new UserDataModel

it1352 0 2020-08-19

.NET Core EndRequest Middleware

I'm builing ASP.NET Core MVC application and I need to have EndRequest event like I had before in Global.asax. How I can achieve this? Solution It's as easy as creating a middleware and making sure it gets registered as soon as possible in the pipeline. For example: public class EndRequestMiddleware { private readonly RequestDelegate _next;

it1352 0 2020-09-09