asp.net-core - 为什么在我的项目中 wwwroot 中不存在 bin 文件夹?

标签 asp.net-core asp.net-core-mvc

我在 Visual Studio 2015 中创建了空项目 asp.net 5。

这是它的样子:

enter image description here

我从一些教程中了解到,bin 文件夹必须位于 wwwroot 中。

但是在 wwwroot 中没有 bin 并且 bin 文件夹在Sensor Observation 项目的任何地方都不存在。

知道为什么我的项目的 wwwroot 中不存在 bin 文件夹吗?

最佳答案

wwwroot 文件夹是您提供静态文件(例如 css、图像、JavaScript 等)的地方。 bin 文件夹中的文件不应该提供给客户端(例如浏览器),因此它不应该放在 wwwroot 文件夹中。

Here is some more information wwwroot 应该包含什么。本质上:

"Enter the wwwroot folder in ASP.NET 5. The wwwroot folder represents the actual root of the web app when running on a web server. Static files, like appsettings.json, which are not located in wwwroot will never be accessible, and there is no need to create special rules to block access to sensitive files. Instead of blacklisting access to sensitive files, a more secure whitelist approach is taken whereby only those files in the wwwroot folder are accessible via web requests."

关于asp.net-core - 为什么在我的项目中 wwwroot 中不存在 bin 文件夹?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36328354/

相关文章:

.net - Windows 身份验证 - .NET Core Angular 应用程序

asp.net-mvc - 在不使用 EF 的情况下在 appsettings.json 中获取多个连接字符串

asp.net-mvc - Entity Framework 核心错误: No parameterless constructor defined for this object

api - Blazor-WASM : Failed to load resource: the server responded with a status of 404 (Not Found)

javascript - 如何使用带有 Razor 的 MVC4 设置 javascript 变量

c# - 从 Azure 中托管的 Asp.net Core MVC Web 应用程序获取 "Response status code does not indicate success: 502 (Bad Gateway)"

c# - ASP.NET核心: Custom IFileProvider prevents default IFileProvider from working

c# - 在 asp.net core 中使用返回 url

c# - 结果过滤器在 ASP.NET Core 中如何工作?

c# - IDesignTimeDbContextFactory 并不总是需要的?