Giter VIP home page Giter VIP logo

Comments (5)

merken avatar merken commented on June 27, 2024 1

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:

/// - No DispatchProxy can be used, backwards compatability is compromised (DispatchProxy requires an interface as base class, not ControllerBase)

from prise.

jakenuts avatar jakenuts commented on June 27, 2024

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.

jakenuts avatar jakenuts commented on June 27, 2024

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.

jakenuts avatar jakenuts commented on June 27, 2024

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.

rfriend-zilo avatar rfriend-zilo commented on June 27, 2024

@jakenuts Any luck with this, im using it with blazor and im so close

from prise.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.