razor-class-library

404 with static content in Razor Class Library (RCL)

*爱你&永不变心* 提交于 2021-02-04 14:15:23
问题 I am having difficulties implementing static files in razor class library (.net Core 3.1) that are consumed by an ASP.NET Core (v3.1) application. When trying to access the static files, I only get an 404 - Not Found. I followed the following answer on Stackoverflow: https://stackoverflow.com/a/57874357/1099519 or I also cross-checked with the documentation at: https://docs.microsoft.com/en-us/aspnet/core/razor-pages/ui-class?view=aspnetcore-3.0&tabs=visual-studio#create-an-rcl-with-static

Using StaticFileOptions() breaks embedded static files from Razor Class Library

风格不统一 提交于 2021-01-28 05:43:21
问题 I'm trying to add long cache headers to static .css and .js files using StaticFileOptions From various SO and other articles, this is how you do it: app.UseStaticFiles(new StaticFileOptions { OnPrepareResponse = ctx => { const int durationInSeconds = 60 * 60 * 24; ctx.Context.Response.Headers[HeaderNames.CacheControl] = "public,max-age=" + durationInSeconds; } }); However, I am using a bunch of static files provided by a RCL. The RCL has a StaticServing.cs class which I have used from this

IntelliSense not working for CSS files in .NET Core 3.1 Razor Class Library when accessed from referencing web applications

久未见 提交于 2020-07-22 07:54:08
问题 I am creating a reusable UI utilizing a .NET Core 3.1 Razor Class Library (RCL) as documented here: https://docs.microsoft.com/en-us/aspnet/core/razor-pages/ui-class?view=aspnetcore-3.1&tabs=visual-studio I am able to create an RCL that includes static assets, and am able to utilize them as documented in the link above. By default, Visual Studio 2019 (16.5.1) only provides IntelliSense for the CSS/JavaScript files in the RCL project itself, not from any of the dependent projects. There is a

IntelliSense not working for CSS files in .NET Core 3.1 Razor Class Library when accessed from referencing web applications

南笙酒味 提交于 2020-07-22 07:51:29
问题 I am creating a reusable UI utilizing a .NET Core 3.1 Razor Class Library (RCL) as documented here: https://docs.microsoft.com/en-us/aspnet/core/razor-pages/ui-class?view=aspnetcore-3.1&tabs=visual-studio I am able to create an RCL that includes static assets, and am able to utilize them as documented in the link above. By default, Visual Studio 2019 (16.5.1) only provides IntelliSense for the CSS/JavaScript files in the RCL project itself, not from any of the dependent projects. There is a

IntelliSense not working for CSS files in .NET Core 3.1 Razor Class Library when accessed from referencing web applications

陌路散爱 提交于 2020-07-22 07:51:04
问题 I am creating a reusable UI utilizing a .NET Core 3.1 Razor Class Library (RCL) as documented here: https://docs.microsoft.com/en-us/aspnet/core/razor-pages/ui-class?view=aspnetcore-3.1&tabs=visual-studio I am able to create an RCL that includes static assets, and am able to utilize them as documented in the link above. By default, Visual Studio 2019 (16.5.1) only provides IntelliSense for the CSS/JavaScript files in the RCL project itself, not from any of the dependent projects. There is a