asp .net core 读取读取Views文件夹下的js和css

//读取Views文件夹下的js和css
app.UseStaticFiles(new StaticFileOptions()
    {
        FileProvider = new PhysicalFileProvider(
            Path.Combine(Directory.GetCurrentDirectory(), @"Views")),
            RequestPath = new PathString("/Views"),
            ContentTypeProvider = new FileExtensionContentTypeProvider(
                new Dictionary(StringComparer.OrdinalIgnoreCase)
                {
                    { ".js", "application/javascript" },
                    { ".css", "text/css" },
                })
    }
);

你可能感兴趣的:(asp .net core 读取读取Views文件夹下的js和css)