Dot Net Stories

asp.net-core c# .net javascript xamarin

Articles about .Net, ASP.NET Core, Xamarin, Javascript, CSS This site is powered by a blog engine built on ASP.NET Core, HTML, Boostrap and jQuery

en

How to inject HttpContext or ActionContext ?

Available in English (English)
asp.net-core
Few tools from the ASP.NET Core framework may be quite useful, but you should use the proper way to access them. This way is not always obvious, and knowing about it makes all the difference.This post explains how to allow injection of HttpContext and ActionContext in another injected class.
en

Building ASP.NET Core web projects using razor libraries

Available in English (English)
c# asp.net-core
Since the ASP.NET Core 2.1 release, it became finally easy to implement independent web libraries embedding everything it needs to set up a feature.This post is the first of a serie, that intends to explain how to set an ASP.NET Core razor MVC library to be used as an independent plugin.Such a lib is autonomous, can be packaged in a NuGet and activated just by refencing this project.
en

How to Include static files in a Razor library

Available in English (English)
asp.net-core razor-library embedded-files static-files embedded-static-files wwwroot
Razor libraries are a great improvement for splitting the development of ASP.NET Core projects into projects, however it still lacks (v2.1) the possibility to easily include static files in libraries, such as images, CSS or javascript files, fonts or web libraries. This posts explains the principle allowing to include static files in a Razor Library for folders of type /wwwroot or /Areas/Feature/wwwroot
en

How to automatically embed static files in ASP.NET Core libraries and Razor libraries

Available in English (English)
asp.net-core razor-library c# embedded-files static-files embedded-static-files
In a previous post, we have seen [how to manually include static files in a razor library](https://dotnetstories.com/blog/How-to-Include-static-files-in-a-Razor-library-en-7156675136), this post will go even further and provide a way to do this automatically. In this article you will learn how to discover libraries that embed static files and include them automatically to serve them with the static file middleware.