[英]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.