Search Results

Search found 1 results on 1 pages for 'user213988'.

Page 1/1 | 1 

  • How can a static class be resolved by the Unity Framework?

    - by user213988
    I wold like the unity framework to resolve a static class "MyStaticObject" specified in my config file. As my class is static, I am getting an error "The type StaticObject does not have an accessible constructor." My config file looks as below: <unity> <typeAliases> <typeAlias alias="singleton" type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity" /> <typeAlias alias="StaticObject" type="MyStaticAssembly.MyStaticObject, MyStaticAssembly, Version=1.0.0.0" /> <typeAlias alias="staticobject" type="MyStaticAssembly.MyStaticObject, MyStaticAssembly" /> </typeAliases> <containers> <container> <types> <type type="StaticObject" mapTo="staticobject" name="My Static Object"> <lifetime type="singleton"/> </type> </types> </container> </containers> </unity> I would highly appreciate any help.

    Read the article

1