//读取Views文件夹下的js和cssapp.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" }, }) });