Comments (1)
The reason I didn't answer it on Stack Overflow is because it's not a minimal reproducible example.
In this case, minimal is the key word. There is a lot you can do to reduce the problem and figure this out yourself, or at least help other folks help you. To start...
- Create a whole new project.
- Set up WebAPI and OWIN.
- Create one controller.
- Create one dependency.
- Call it ScriptExecutionHost.
- No parameters in the constructor.
- Register that as a singleton.
- Verify singletons work as expected.
I guarantee singletons work. Now you've established that the issue is with app code, not Autofac, and that the question is definitely a "how do I?" question and not a bug. (This is why I'm going to close this issue after I comment here.)
Now add a single string parameter to the minimal ScriptExecutionHost.
You should end up with a fraction of the NuGet dependencies and none of the irrelevant code to do with credentials managers and file downloads and all that junk.
Cool, so now you can start figuring out how to inject the string parameter, for which we have an FAQ that can help give you ideas.
While I'd love to be able to personally work with folks and answer every question, the reason we point folks to SO and very explicitly away from issues is that none of the Autofac maintained have the time to offer free consulting hours. There's no paid team here, no one has a "job writing and supporting Autofac," so we have to rely on the community. The community doesn't monitor issues, so they're reserved for actual issues. We do monitor SO but there's no way we can personally answer each question, especially if a question looks like it's going to eat a lot of time to answer - those invariably turn from "question" into "let's iterate over the code and have a discussion and get clarification..." and it becomes a days-long support issue. (I think the Code Review Stack Overflow handles the iteration and discussion questions.) Just writing this answer up was a half hour. Answers take time. Lots of time.
Anyway, that's all I can offer here. I hope it helps unblock you. Sorry I can't offer more.
from autofac.owin.
Related Issues (20)
- OwinLifetimeScopeKey configurable HOT 30
- External creation of ILifetimeScope HOT 15
- Is the dispose of the lifetime made too soon? HOT 18
- .NET Standard / .NET Core support? HOT 4
- Include the latest stable version of Microsoft.Owin (4.0.0) in dependencies HOT 6
- Autofac.Owin 4.2.0 seems to require Microsoft.Owin 3.0.0 HOT 1
- Put the registration into middlewares HOT 1
- Compatibility with Autofac v6 HOT 3
- Memory Leak Due to ThreadLocalStorage / ConcurrentBag / LifetimeScope Behavior in Owin HOT 15
- Middleware registration order is inverted during resolve HOT 4
- IAsyncDisposable HOT 1
- owin autofac middleware and controller lifetime not same one HOT 1
- 7.0.0 introduced memory leak due to async disposal issue in main Autofac HOT 10
- Nuget package cannot be installed against latest version of Autofac.
- Provide the ability to control middleware execution order in the OWIN integration HOT 3
- Move DisposeScopeOnAppDisposing from Web API OWIN integration into core OWIN integration HOT 1
- Allow DI for IAppBuilder.Run HOT 3
- Only Microsoft.Owin.Middleware HOT 2
- Middleware injection doesn't work with ACTNARS HOT 5
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 autofac.owin.