[英]How to register custom file extension to JavaScript editor in Visual Studio 2010/2012?
[英]How to define the HTML file extension in Visual Studio?
你没有把正确的路径放在那里。 您的“style.css”在“theme/src/style.css”中,而不是在“theme/style.css”中。 也使用 VS Code 而不是 Visual Studio,因为如果你只创建文件是没用的。 此外,您没有提供 JS 文件夹和 CSS 文件夹中的所有文件。
首先,您需要在Startup中配置服务 static 文件
app.UseStaticFiles(); //serves wwwroot by default
要为您的theme
文件夹提供服务,您需要添加以下行
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(
Path.Combine(Directory.GetCurrentDirectory(), "theme")),
RequestPath = "/theme"
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.