Category Archives for ASP.NET Core

ASP.NET Core – Unit testing IAuthorizationService and dependencies inside of your controller

Unit Testing – IAuthorizationService, Requirement and Handler You have a controller that makes use of IAuthorizationService and you have a custom requirement – implementation of IAuthorizationRequirement. You might also have your custom handler which is an implementation of IAuthorizationHandler. As an honourable .NET Core citizen, you are doing some unit tests for your controller and […]

Continue reading

ASP.NET Core – InvalidOperationException: Cannot find compilation library location for package ‘Microsoft.Win32.Registry’

TL;DR Add following line to your .csproj file: <MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish> Introduction I was publishing a project I am working on to web server (Linux) and I had an issue with Razor Pages. However, it seems that this error occurs only when you precompile your Razor views (MVC views, Razor Pages). Why would you do that? Well, […]

Continue reading
1 2 3 7