Topshelf.SimpleInjector | Put your apps on the Topshelf , with the power | Dependency Injection library
kandi X-RAY | Topshelf.SimpleInjector Summary
kandi X-RAY | Topshelf.SimpleInjector Summary
[Coverage Status] Put your apps on the Topshelf, with the power of SimpleInjector! Topshelf.SimpleInjector provides extensions to construct your Topshelf service class from the SimpleInjector IoC container. Project Status
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Topshelf.SimpleInjector
Topshelf.SimpleInjector Key Features
Topshelf.SimpleInjector Examples and Code Snippets
Community Discussions
Trending Discussions on Topshelf.SimpleInjector
QUESTION
I am using TopShelf, Quartz and SimpleInjector. So I keep having this exception, I tried doing hybrid, but ended up with
"is registered as 'Hybrid Async Scoped / Web Request' lifestyle, but the instance is requested outside the context of an active (Hybrid Async Scoped / Web Request) scope"
When I don't use the simpleinjector and simple call the class without passing interfaces in the constructor, it calls the Start method, but if I do use the simpleinjector it doesn't call the specified FooService:
...ANSWER
Answered 2019-Sep-25 at 04:53So I already solved the answer by reading the following URL: https://simpleinjector.readthedocs.io/en/latest/decisions.html#don-t-allow-resolving-scoped-instances-outside-an-active-scope
It just meant that the lifestyle being used is wrong for particular set of classes (for example you are forcing async scope or other, but it should have been a singleton or transient)
It turns out that all classes using or inheriting DbContext and those that use HttpClient should use "Lifestyle.Singleton" and if they have any dependencies (meaning another class was injected in them) then they should use a Lifestyle.Singleton as well.
I ended up using a hybrid, and applied this lifestyle to ALL the other injected classes (except for those using singletons)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Topshelf.SimpleInjector
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page