RegisterType from unity configuration fileHow to store Node.js deployment settings/configuration files?Unity Container error using Prism Modularity and including Unity by sourceXML config changes in Unity 2.0Unity, LoadConfiguration from alternative files and sectionExtensionError when using config file for Interception in UnityHow to keep the Shell configurable with PRISM 4.1 & Unity?How to define alias for PerRequestLifetimeManager, getting “could not be resolved” errorConfiguring instances in Unity Container configured in App.Config at runtimeIs Prism 6.3.0 tied to an older version of Unity (I can't seem to upgrade)Could not load file or assembly 'Microsoft.Practices.Unity, Version=4.0.0.0 OR Is Unity 5.8.11 supported for Prism 7.0.0.396 with WPF?
Is induction neccessary for proving that every injective mapping of a finite set into itself is a mapping onto itself?
Identifying a transmission to myself
Was there ever a Kickstart that took advantage of 68020+ instructions that would work on an A2000?
Father and Son and Grandsons
Moving the subject of the sentence into a dangling participle
Junior developer struggles: how to communicate with management?
Does this article imply that Turing-Computability is not the same as "effectively computable"?
Is there a term for the words whose stress is on the first syllable?
A non-technological, repeating, phenomenon in the sky, holding its position in the sky for hours
How did Arya get her dagger back from Sansa?
Number of seconds in 6 weeks
Missed the connecting flight, separate tickets on same airline - who is responsible?
Would glacier 'trees' be plausible?
How can I close a gap between my fence and my neighbor's that's on his side of the property line?
How would adding a darkvision racial trait to Dragonborn affect balance?
What are the differences between credential stuffing and password spraying?
What happens if I start too many background jobs?
Where can I go to avoid planes overhead?
How can I support myself financially as a 17 year old with a loan?
Is there a legal ground for stripping the UK of its UN Veto if Scotland and/or N.Ireland split from the UK?
Why was the battle set up *outside* Winterfell?
In Endgame, why were these characters still around?
Point of the the Dothraki's attack in GoT S8E3?
Which industry am I working in? Software development or financial services?
RegisterType from unity configuration file
How to store Node.js deployment settings/configuration files?Unity Container error using Prism Modularity and including Unity by sourceXML config changes in Unity 2.0Unity, LoadConfiguration from alternative files and sectionExtensionError when using config file for Interception in UnityHow to keep the Shell configurable with PRISM 4.1 & Unity?How to define alias for PerRequestLifetimeManager, getting “could not be resolved” errorConfiguring instances in Unity Container configured in App.Config at runtimeIs Prism 6.3.0 tied to an older version of Unity (I can't seem to upgrade)Could not load file or assembly 'Microsoft.Practices.Unity, Version=4.0.0.0 OR Is Unity 5.8.11 supported for Prism 7.0.0.396 with WPF?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am migrating from Prism 4 to Prism 7.1, I cannot seem to find the ConfigureContainer method has been removed from the latest Prism release. In the past, I had used this method to load the unity configuration from the file system.
with the latest version of the Prism library, this appears not to be possible.
I have already explored the option of ModuleConfiguration, which to me does not provide the ability to inject dependencies through a configuration file in the same way.
Is there an alternate approach for this, where I can provide type registration through a configuration file.
Here is how I did it in the past:
1- In the BootStrapper following method was overridden:
protected override void ConfigureContainer()
base.ConfigureContainer();
var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
UnityConfigurationSection section = (UnityConfigurationSection)config.GetSection("unity");
if (section != null)
section.Configure(Container);
2- Add config section in the app.config file:
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection,Microsoft.Practices.Unity.Configuration" />
3- Add a unity config file which looks like:
<unity xmlns="schemas.microsoft.com/practices/2010/unity">
<sectionExtension type="Unity.FactoryConfig.FactoryConfigExtension, Unity.FactoryConfig"/>
<alias alias="Singleton" type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity"/>
<alias alias="ConfigFactory" type="Vms.Pt.Common.DependencyInjection.ComponentBuilder.ConfigClassFactory`1, Vms.Pt.Common.DependencyInjection.ComponentBuilder"/>
<container>
<!--Modal/popup provider service-->
<register type="IPopupService, GUI.Infrastructure"
mapTo="Services.PopupService, GUI.Infrastructure">
<lifetime type="Singleton"/>
</register>
</container>
</unity>
unity-container prism configuration-files
add a comment |
I am migrating from Prism 4 to Prism 7.1, I cannot seem to find the ConfigureContainer method has been removed from the latest Prism release. In the past, I had used this method to load the unity configuration from the file system.
with the latest version of the Prism library, this appears not to be possible.
I have already explored the option of ModuleConfiguration, which to me does not provide the ability to inject dependencies through a configuration file in the same way.
Is there an alternate approach for this, where I can provide type registration through a configuration file.
Here is how I did it in the past:
1- In the BootStrapper following method was overridden:
protected override void ConfigureContainer()
base.ConfigureContainer();
var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
UnityConfigurationSection section = (UnityConfigurationSection)config.GetSection("unity");
if (section != null)
section.Configure(Container);
2- Add config section in the app.config file:
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection,Microsoft.Practices.Unity.Configuration" />
3- Add a unity config file which looks like:
<unity xmlns="schemas.microsoft.com/practices/2010/unity">
<sectionExtension type="Unity.FactoryConfig.FactoryConfigExtension, Unity.FactoryConfig"/>
<alias alias="Singleton" type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity"/>
<alias alias="ConfigFactory" type="Vms.Pt.Common.DependencyInjection.ComponentBuilder.ConfigClassFactory`1, Vms.Pt.Common.DependencyInjection.ComponentBuilder"/>
<container>
<!--Modal/popup provider service-->
<register type="IPopupService, GUI.Infrastructure"
mapTo="Services.PopupService, GUI.Infrastructure">
<lifetime type="Singleton"/>
</register>
</container>
</unity>
unity-container prism configuration-files
add a comment |
I am migrating from Prism 4 to Prism 7.1, I cannot seem to find the ConfigureContainer method has been removed from the latest Prism release. In the past, I had used this method to load the unity configuration from the file system.
with the latest version of the Prism library, this appears not to be possible.
I have already explored the option of ModuleConfiguration, which to me does not provide the ability to inject dependencies through a configuration file in the same way.
Is there an alternate approach for this, where I can provide type registration through a configuration file.
Here is how I did it in the past:
1- In the BootStrapper following method was overridden:
protected override void ConfigureContainer()
base.ConfigureContainer();
var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
UnityConfigurationSection section = (UnityConfigurationSection)config.GetSection("unity");
if (section != null)
section.Configure(Container);
2- Add config section in the app.config file:
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection,Microsoft.Practices.Unity.Configuration" />
3- Add a unity config file which looks like:
<unity xmlns="schemas.microsoft.com/practices/2010/unity">
<sectionExtension type="Unity.FactoryConfig.FactoryConfigExtension, Unity.FactoryConfig"/>
<alias alias="Singleton" type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity"/>
<alias alias="ConfigFactory" type="Vms.Pt.Common.DependencyInjection.ComponentBuilder.ConfigClassFactory`1, Vms.Pt.Common.DependencyInjection.ComponentBuilder"/>
<container>
<!--Modal/popup provider service-->
<register type="IPopupService, GUI.Infrastructure"
mapTo="Services.PopupService, GUI.Infrastructure">
<lifetime type="Singleton"/>
</register>
</container>
</unity>
unity-container prism configuration-files
I am migrating from Prism 4 to Prism 7.1, I cannot seem to find the ConfigureContainer method has been removed from the latest Prism release. In the past, I had used this method to load the unity configuration from the file system.
with the latest version of the Prism library, this appears not to be possible.
I have already explored the option of ModuleConfiguration, which to me does not provide the ability to inject dependencies through a configuration file in the same way.
Is there an alternate approach for this, where I can provide type registration through a configuration file.
Here is how I did it in the past:
1- In the BootStrapper following method was overridden:
protected override void ConfigureContainer()
base.ConfigureContainer();
var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
UnityConfigurationSection section = (UnityConfigurationSection)config.GetSection("unity");
if (section != null)
section.Configure(Container);
2- Add config section in the app.config file:
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection,Microsoft.Practices.Unity.Configuration" />
3- Add a unity config file which looks like:
<unity xmlns="schemas.microsoft.com/practices/2010/unity">
<sectionExtension type="Unity.FactoryConfig.FactoryConfigExtension, Unity.FactoryConfig"/>
<alias alias="Singleton" type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity"/>
<alias alias="ConfigFactory" type="Vms.Pt.Common.DependencyInjection.ComponentBuilder.ConfigClassFactory`1, Vms.Pt.Common.DependencyInjection.ComponentBuilder"/>
<container>
<!--Modal/popup provider service-->
<register type="IPopupService, GUI.Infrastructure"
mapTo="Services.PopupService, GUI.Infrastructure">
<lifetime type="Singleton"/>
</register>
</container>
</unity>
unity-container prism configuration-files
unity-container prism configuration-files
edited Mar 23 at 17:20
Haukinger
5,9022823
5,9022823
asked Mar 22 at 20:55
Imran TariqImran Tariq
184
184
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
It's now called RegisterTypes
in the PrismApplicationBase
. Just override that and do whatever you would have done in ConfigureContainer
.
Hint: if you don't like the "abstraction" Prism 7 put between you and IUnityContainer
, you can call GetContainer()
on the IContainerRegistry
(it's an extension method) to get the hidden IUnityContainer
instance.
All of that I understand, I guess my question is still the same. As UnityConfigurationSection class is no longer available in Prism 7, is there an alternate way to do dependency injection using a configuration file?
– Imran Tariq
Mar 25 at 13:48
Why shouldUnityConfigurationSection
not be available? Btw, that has absolutely nothing to do with Prism... github.com/unitycontainer/configuration/blob/master/src/Section/…
– Haukinger
Mar 25 at 18:23
Thank got it. I had to downgrade the Unity.Abstraction nugget to V3.31 to make the configuration work. It does not work with the latest version of the Nugget.
– Imran Tariq
Mar 27 at 15:18
add a comment |
Thanks Haukinger. I had to downgrade the Unity.Abstractions nugget to V3.31 to make the configuration work with prism 7. It does not work with the latest version of the Nugget.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55307647%2fregistertype-from-unity-configuration-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
It's now called RegisterTypes
in the PrismApplicationBase
. Just override that and do whatever you would have done in ConfigureContainer
.
Hint: if you don't like the "abstraction" Prism 7 put between you and IUnityContainer
, you can call GetContainer()
on the IContainerRegistry
(it's an extension method) to get the hidden IUnityContainer
instance.
All of that I understand, I guess my question is still the same. As UnityConfigurationSection class is no longer available in Prism 7, is there an alternate way to do dependency injection using a configuration file?
– Imran Tariq
Mar 25 at 13:48
Why shouldUnityConfigurationSection
not be available? Btw, that has absolutely nothing to do with Prism... github.com/unitycontainer/configuration/blob/master/src/Section/…
– Haukinger
Mar 25 at 18:23
Thank got it. I had to downgrade the Unity.Abstraction nugget to V3.31 to make the configuration work. It does not work with the latest version of the Nugget.
– Imran Tariq
Mar 27 at 15:18
add a comment |
It's now called RegisterTypes
in the PrismApplicationBase
. Just override that and do whatever you would have done in ConfigureContainer
.
Hint: if you don't like the "abstraction" Prism 7 put between you and IUnityContainer
, you can call GetContainer()
on the IContainerRegistry
(it's an extension method) to get the hidden IUnityContainer
instance.
All of that I understand, I guess my question is still the same. As UnityConfigurationSection class is no longer available in Prism 7, is there an alternate way to do dependency injection using a configuration file?
– Imran Tariq
Mar 25 at 13:48
Why shouldUnityConfigurationSection
not be available? Btw, that has absolutely nothing to do with Prism... github.com/unitycontainer/configuration/blob/master/src/Section/…
– Haukinger
Mar 25 at 18:23
Thank got it. I had to downgrade the Unity.Abstraction nugget to V3.31 to make the configuration work. It does not work with the latest version of the Nugget.
– Imran Tariq
Mar 27 at 15:18
add a comment |
It's now called RegisterTypes
in the PrismApplicationBase
. Just override that and do whatever you would have done in ConfigureContainer
.
Hint: if you don't like the "abstraction" Prism 7 put between you and IUnityContainer
, you can call GetContainer()
on the IContainerRegistry
(it's an extension method) to get the hidden IUnityContainer
instance.
It's now called RegisterTypes
in the PrismApplicationBase
. Just override that and do whatever you would have done in ConfigureContainer
.
Hint: if you don't like the "abstraction" Prism 7 put between you and IUnityContainer
, you can call GetContainer()
on the IContainerRegistry
(it's an extension method) to get the hidden IUnityContainer
instance.
answered Mar 23 at 17:26
HaukingerHaukinger
5,9022823
5,9022823
All of that I understand, I guess my question is still the same. As UnityConfigurationSection class is no longer available in Prism 7, is there an alternate way to do dependency injection using a configuration file?
– Imran Tariq
Mar 25 at 13:48
Why shouldUnityConfigurationSection
not be available? Btw, that has absolutely nothing to do with Prism... github.com/unitycontainer/configuration/blob/master/src/Section/…
– Haukinger
Mar 25 at 18:23
Thank got it. I had to downgrade the Unity.Abstraction nugget to V3.31 to make the configuration work. It does not work with the latest version of the Nugget.
– Imran Tariq
Mar 27 at 15:18
add a comment |
All of that I understand, I guess my question is still the same. As UnityConfigurationSection class is no longer available in Prism 7, is there an alternate way to do dependency injection using a configuration file?
– Imran Tariq
Mar 25 at 13:48
Why shouldUnityConfigurationSection
not be available? Btw, that has absolutely nothing to do with Prism... github.com/unitycontainer/configuration/blob/master/src/Section/…
– Haukinger
Mar 25 at 18:23
Thank got it. I had to downgrade the Unity.Abstraction nugget to V3.31 to make the configuration work. It does not work with the latest version of the Nugget.
– Imran Tariq
Mar 27 at 15:18
All of that I understand, I guess my question is still the same. As UnityConfigurationSection class is no longer available in Prism 7, is there an alternate way to do dependency injection using a configuration file?
– Imran Tariq
Mar 25 at 13:48
All of that I understand, I guess my question is still the same. As UnityConfigurationSection class is no longer available in Prism 7, is there an alternate way to do dependency injection using a configuration file?
– Imran Tariq
Mar 25 at 13:48
Why should
UnityConfigurationSection
not be available? Btw, that has absolutely nothing to do with Prism... github.com/unitycontainer/configuration/blob/master/src/Section/…– Haukinger
Mar 25 at 18:23
Why should
UnityConfigurationSection
not be available? Btw, that has absolutely nothing to do with Prism... github.com/unitycontainer/configuration/blob/master/src/Section/…– Haukinger
Mar 25 at 18:23
Thank got it. I had to downgrade the Unity.Abstraction nugget to V3.31 to make the configuration work. It does not work with the latest version of the Nugget.
– Imran Tariq
Mar 27 at 15:18
Thank got it. I had to downgrade the Unity.Abstraction nugget to V3.31 to make the configuration work. It does not work with the latest version of the Nugget.
– Imran Tariq
Mar 27 at 15:18
add a comment |
Thanks Haukinger. I had to downgrade the Unity.Abstractions nugget to V3.31 to make the configuration work with prism 7. It does not work with the latest version of the Nugget.
add a comment |
Thanks Haukinger. I had to downgrade the Unity.Abstractions nugget to V3.31 to make the configuration work with prism 7. It does not work with the latest version of the Nugget.
add a comment |
Thanks Haukinger. I had to downgrade the Unity.Abstractions nugget to V3.31 to make the configuration work with prism 7. It does not work with the latest version of the Nugget.
Thanks Haukinger. I had to downgrade the Unity.Abstractions nugget to V3.31 to make the configuration work with prism 7. It does not work with the latest version of the Nugget.
answered Mar 27 at 15:21
Imran TariqImran Tariq
184
184
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55307647%2fregistertype-from-unity-configuration-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown