Comments (5)
Hi James,
Thanks for your interest, I take a look at your example and see what the culprit is.
I must say in advance that Razor Views are a bit edgy to work with, classic assemblies can be loaded without issue, but including assets (like views) may result in dropping the hotswapping support, as you might've seen in the source code:
Prise/src/Prise.Mvc/PriseMvcExtensions.cs
Line 69 in 15432b2
from prise.
Here is an example project with two RCL's, one statically linked to the web project, one loaded dynamically. By default new RCL's use MVC Areas but I've tried it without areas and get the same result, can call a controller and get a content result but when it returns a view it can't be found.
https://github.com/jakenuts/PriseMvcExample
from prise.
Thanks so much!
I was able to load and render Razor Pages if I add a CompiledRazorAssemblyPart after the PluginAssemblyPart. That seems to match how the statically linked RCL works. I added diagnostic views to the example home page so you can see the routes & parts before and after enabling a plugin.
I think the backwards compatability is less of an issue for me, through unloading the assemblies is definitely something I'd hope to preserve. I'll do some tests loading/unloading RCL's with their views to see what sort of objects stick around after they should be gone.
I think the only remaining piece I haven't gotten working is the view location, the controller can be called, razor pages rendered but when it looks for an MVC view it fails - probably a view location list that is created at startup and needs to be updated on load/unload.
from prise.
Found it! Needed a CustomViewCompiler that could be reset (Hot Reload does this with the default one). I added a CompiledRazorAssemblyPart along with the PluginAssemblyPart and reset that cache and now it loads and displays the view. Will try to clean it up and see if I can add the new views rather than clearing the entire cache. Guess I'll also need to remove views that are being unloaded. So close..
from prise.
@jakenuts Any luck with this, im using it with blazor and im so close
from prise.
Related Issues (20)
- PluginBootstrapper.Bootstrap event called on each Http Get Request HOT 2
- Invoke Plugin Publish command from Post Build Events HOT 1
- Plugin not found during scanning because of folder "runtimes" HOT 3
- How to inject ILogger<T> HOT 1
- Question: Plugins from parallel projects (on solution) HOT 1
- DependencyInjection with MvcPluginLoader HOT 4
- [Enhancement] Wrapper HOT 1
- Dependency management question HOT 1
- [Enhancement] DependaBot 🤖 HOT 1
- [Enhancement] MAUI support ? HOT 1
- [Enhancement] "anything".plugin.json HOT 1
- services.AddPrise() middleware seems to be missing in latest .net 6 version release HOT 1
- FindPlugin Problem HOT 2
- DI With Blazor components
- [Question] From the Host Web API's perspective: Is there a way to limit max execution time of a plugin?
- Prise Publish-plugin extension for VS 2022
- Why is TaskCanceledException not being caught but other exceptions are? HOT 1
- dotnet pack .nupkg , when UnCompressNugetPackage, not include xxx.deps.json
- State of the Project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prise.