I'm rewriting a plugin from CMS 11 to CMS 12 and in CMS 11 the module was places in /modules/MyPlugin/.I that folder we have some img, js and css under /modules/MyPlugin/ClientResources/css/my.css or /modules/MyPlugin/ClientResources/img/myimage.jpg for example.
In CMS 11 I could just use the URL https://localhost:1234/modules/MyPlugin/ClientResources/img/myimage.jpg and the image would render but if I use the same URL now if just get a 404.
I have views in /modules/MyPlugin/Views/ that I can access and they are rendered and it is these views that contains links to the static content above.
What do I need to do to have access to the static content in my plugin folder?
So this actually solved the problem.
FileProvider = new PhysicalFileProvider(
Path.Combine(env.ContentRootPath, "modules", "MyPlugin", "ClientResources")),
RequestPath = "/modules/MyPlugin/ClientResources"
Is this the correct way of doing it?
More info here: