I’ll continue my journey using Razor Class Libraries in ASP.NET Core.
Here are my previous posts:
- ASP.NET Core – Razor Class Libraries
- Razor Class Libraries - Views not found
- Razor Class Libraries – Static Content
Today I want to write a small addition to my post from yesterday. As I mentioned yesterday to reference some content inside your razor views you need to use a path similar to _content/{LIBRARY NAME}.
This path doesn’t look so nice. Luckily you change it to a different path name by editing the RCL project properties and adding a StaticWebAssetBasePath.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<PropertyGroup> | |
<StaticWebAssetBasePath >/myownpath</StaticWebAssetBasePath> | |
</PropertyGroup> |
Now you can access your files using /myownpath/example.css.