I am facing below issue while migrating .Net Core 2.2 MVC project to 3.1 .
Method not found: 'System.Collections.Generic.IList`1<Microsoft.Extensions.FileProviders.IFileProvider> Microsoft.AspNetCore.Mvc.Razor.RazorViewEngineOptions.get_FileProviders()'.
Any Suggestions are welcome.
Below is the sample Code.
ConfigureServices Method.
services.Configure<MvcRazorRuntimeCompilationOptions>(options => { options.FileProviders.Clear(); options.FileProviders.Add(new EmbeddedFileProvider(typeof(HomeController).GetType().Assembly)); }); services.AddControllersWithViews().AddRazorRuntimeCompilation();
Configure Method.
app.UseRouting(); app.UseEndpoints(endpoints => { // Mapping of endpoints goes here: endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}"); });
Controller.
public class HomeController : Controller { public IActionResult Index() { return View(); } }
Let me know If further details are required.
.csproj
? It sounds like your rerences aren’t properly updated. – poke