身份的 site.css 文件位于何处? [英] Where is the site.css file located for Identity?

查看:12
本文介绍了身份的 site.css 文件位于何处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 asp.net core 2.1 MVC 应用程序.我已经运行了 Scaffold Identity,它生成了所有使用的 HTML 和模型.但是我找不到 identity 用于其布局的 css 文件?

I have an asp.net core 2.1 MVC application. I have ran the Scaffold Identity which has generated all the HTML and models used. I can't however find the css file that identity is using for its layouts?

在 chrome 开发人员工具中,它告诉我 site.css 正在从 /Identity/css/site.css 加载,而 bootstrap 正在从 /Identity/lib/bootstrap/dist/加载css/bootstrap.css.这些文件似乎在我的项目中的任何地方都不存在.我错过了什么吗?

In chrome developer tools it tells me site.css is being loaded from /Identity/css/site.css and bootstrap is being loaded from /Identity/lib/bootstrap/dist/css/bootstrap.css. These files don't seem to exist anywhere in my project. Am I missing something?

它没有使用位于 wwwroot/css 中的 site.css 文件.

It's not using the site.css file that's located in wwwroot/css.

推荐答案

Identity 默认 UI 是 Razor 类库.静态资源被嵌入并从库中加载.具体来说,静态文件中间件使用 ManifestEmbeddedFileProvider 加载嵌入资源,就像它们在文件系统上一样.

The Identity default UI is a Razor Class Library. The static resources are being embedded and loaded from the library. Specifically, the Static Files middleware is loading up the embedded resources as if they were on the filesystem, using a ManifestEmbeddedFileProvider.

无论长短,您都可以通过在项目中的相同位置创建文件来覆盖它们.然后,您的项目版本将接管.不幸的是,脚手架也没有提供脚手架静态资源的方法.但是,您可以简单地在浏览器中查看源代码,然后将其复制到项目的文件版本中.

Long and short, you can override those by simply creating files in the same location in your project. Then, your project's versions will take over. Unfortunately, the scaffold doesn't provide a way to scaffold static resources as well. However, you can simply view the source in your browser and then copy that into your project's version of the file.

您也可以在此处查看 RCL 的源代码.这样你就可以引用你需要的任何代码,甚至不需要脚手架.您添加到自己项目中的任何内容都会覆盖来自 RCL 的内容.

You can also view the source of the RCL here. That way you can reference whatever code you need, without even needing the scaffold. Anything you add to your own project overrides what's coming from the RCL.

这篇关于身份的 site.css 文件位于何处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆