I have an asp.net core 3.0 website and I am trying to use FileProvider. I created the below based on an example, but I keep getting the error
InvalidOperationException: Could not load the embedded file manifest 'Microsoft.Extensions.FileProviders.Embedded.Manifest.xml' for assembly 'Test'.
Below is my startup class
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Threading.Tasks; using IntranetPages.Shared; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.AspNetCore.Server.IISIntegration; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Hosting; namespace Test { public class Startup { private readonly IWebHostEnvironment _env; public Startup(IWebHostEnvironment env, IConfiguration configuration) { Configuration = configuration; _env = env; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddRazorPages(); services.AddAuthentication(IISDefaults.AuthenticationScheme); services.AddTransient<IClaimsTransformation, CustomClaimsTransformer>(); services.AddSingleton<IAuthorizationHandler, CheckGroupHandler>(); var physicalProvider = _env.ContentRootFileProvider; var manifestEmbeddedProvider = new ManifestEmbeddedFileProvider(typeof(Program).Assembly); var compositeProvider = new CompositeFileProvider(physicalProvider, manifestEmbeddedProvider); services.AddSingleton<IFileProvider>(compositeProvider); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); }); } } } What am I missing? I tried installing the NuGet packages, but it made no difference.