Questions tagged [tinyioc]

a .NET-based Inversion of Control container for small projects & libraries.

75 questions
0
votes
0 answers

ReleaseObject of ITinyIoCObjectLifetimeProvider is not being called

I have implemented custom lifetime provider in order to have singleton DB context per job in hangfire. The problem in code below is that created instances are not being released. My question is: Why ReleaseObject method is not called? public class…
Vasyl Senko
  • 1,779
  • 20
  • 33
0
votes
2 answers

TinyIOC register class with constructor using registered types and specified type

I want to register a class that uses previously registered type in its constructor, but is also has a constructor parameter that needs to be specified. ConnectionEngine needs to be created with new BackgroundWorkerPoll(1000). How do I do this? …
pogorman
  • 1,641
  • 2
  • 22
  • 41
0
votes
1 answer

Registering a Serializer for Nancy which uses the NancyContext

I want to use custom serialization for my Nancy Modules, which uses the requested URL as part of its inputs. I've seen that you need to register dependencies that use the context in an override of the ConfigureRequestContainer (as answered in C# IOC…
perfectionist
  • 4,256
  • 1
  • 23
  • 34
0
votes
1 answer

How to Dispose DI Injection chain from main instance

https://github.com/int6/CoiniumServ/blob/develop/src/CoiniumServ/Pools/Pool.cs this is my pool class. i want that when i dispose the class. all dependencies should be stop working and dispose it self. i tried and implement idisposable to all…
0
votes
1 answer

C# IOC and Request State in NancyFX

I want to inject a class into my module using the IOC framework in NancyFX, and I want that class to have access to the Context, just like the module does. How would I do that? The module has a property called Context, that doesn't seem to be…
Jay Pete
  • 4,123
  • 4
  • 35
  • 51
0
votes
1 answer

How can I inject IPrincipal using TinyIoC?

This line: container.Register().UsingConstructor(() => HttpContext.Current.User); throws the following exception: Cannot register type System.Security.Principal.IPrincipal - abstract classes or interfaces are not valid implementation…
tsage080667
  • 89
  • 1
  • 10
0
votes
1 answer

Creating an MVC controller factory for TinyIoC that considers contructor arguements

I've been playing around with a couple of DI containers and I like TinyIoC. I was first introduced to it through Nancy/fx. I'm trying to use it on a current MVC project but cannot seem to get it to instantiate controllers that contain interface…
tsage080667
  • 89
  • 1
  • 10
0
votes
1 answer

Configure NancyFx dependency injection at runtime

I am working on a side-project involving a small self-hosted Nancy server for the local network to remotely control a media player. To enable support for multiple players I implemented a simple plugin mechanism like it was outlined…
MrFloya
  • 137
  • 2
  • 10
0
votes
2 answers

RegisterMultiple does not keep implementation type as singleton if registered as multiple registration types?

I am trying to add a type called TypeA as two different registration types: InterfaceA and InterfaceB. container.RegisterMultiple(typeof(InterfaceA), new[] {typeof(TypeA), typeof(TypeB)}); container.RegisterMultiple(typeof(InterfaceB), new[]…
Stmated
  • 477
  • 5
  • 17
0
votes
0 answers

Nancy TinyIoC error after RavenDB client lib upgrade

I'm getting this error after upgrading the RavenDB client libs from 2.5.2666 to 2.5.2851 Method 'DeleteByIndexAsync' in type 'Raven.Client.Embedded.EmbeddedAsyncServerClient' from assembly 'Raven.Client.Embedded, Version=2.5.0.0, Culture=neutral,…
RobertTheGrey
  • 8,645
  • 5
  • 32
  • 45
0
votes
2 answers

TinyIoC Returning Same instance

I am new to the dependency injection pattern and I am having issues getting a new instance of a class from container.Resolve in tinyioc it just keeps returning the same instance rather than a new instance. Now for the code public abstract class…
mitchellsg
  • 486
  • 5
  • 13
0
votes
2 answers

NancyFx and TinyIoC provide single instance to module

Iv got a fairly simlpe question. Im using Nancy with a windows form (passed through the constructor (autoresolve)). If i let nancy resolve automatically every module it creates a new instance of the form, which is not what i want. I thought maybe i…
peshkatari
  • 151
  • 3
  • 15
0
votes
1 answer

Nancy / TinyIoC "works on my machine" issue

So I have this webapp that I've been developing over the last half year or so. Recently I discovered that NancyFx had been upgraded to 0.16 on nuget and went to upgrade (from 0.12). Things went fine, or rather seemed to go fine, on my…
Mikkel Løkke
  • 3,710
  • 23
  • 37
0
votes
2 answers

WPF Designer load failure using IoC

I have a fairly simple and standard MVVM WPF app. I am using TinyIoC as a containter to provide the underlying data and cache providers for the ViewModels. I am using TinyIoC because I want to also share this code with MonoTouch and Monodroid…
IUnknown
  • 2,596
  • 4
  • 35
  • 52
0
votes
1 answer

TinyIoc - how do I configure all interface registrations AsPerRequestSingleton?

/// /// Starts up the Application. /// /// The container. /// The pipelines. protected override void…
Mark Withers
  • 1,462
  • 5
  • 16
  • 34
1 2 3 4
5