用于Identity的site.css文件在哪里? [英] Where is the site.css file located for Identity?

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

问题描述

我有一个asp.net核心2.1 MVC应用程序.我已经运行了Scaffold Identity,它生成了所有使用的HTML和模型.但是,我找不到标识正用于其布局的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文件.

推荐答案

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.

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

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