Comments (4)
Hi Martijn,
Have you looked at the example (Example.Mvc.Razor) https://github.com/merken/Prise/blob/master/samples/Example.Mvc.Razor/Controllers/HomeController.cs ?
All service registration should be done in the ConfigureServices method in .NET, not sure why you'd move that to the Configure method (this is mainly for App configuration, not services)
https://github.com/merken/Prise/blob/master/samples/Example.Mvc.Razor/Startup.cs#L31
from prise.
Thanks. I've looked at the code provided however I want to enable these plugins as soon as the application boots. Which is why I am doing it in ConfigureServices
however it's not recommended to ues BuildServiceProvider()
inside of ConfigureServices
hence why I wanted to move it to Configure
However when the plugins are booted in ConfigureServices the controllers correctly construct with DepedencyInjecten but if it's called in Configure() it is not.
from prise.
Also when I followed the example code in the repository this error occurs when trying to go to the route:
Prise.Activation.PluginActivationException: Plugin of type TestController could not be activated.
at Prise.Activation.DefaultRemotePluginActivator.CreateRemoteInstance(IPluginActivationContext pluginActivationContext, IPluginBootstrapper bootstrapper, IServiceCollection hostServices)
at Prise.Mvc.DefaultPriseMvcControllerActivator.Create(ControllerContext context)
at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
However when loaded in ConfigureServices it works perfectly fine.
from prise.
Hi Martijn,
Please provide a reproduction repo for this.
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
- [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
- Feature - Add support for Razor Class Library views HOT 5
- 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.