I have successfully upgraded EPI 10 to 11. Everything worked fine but except one.
This is not exactly related to EPI Upgrade, but related to code.
When I trying to edit FeaturedBlocks from CMS, I get the below error:
+ $exception {"No default instance or named instance 'Default' for requested plugin type IBlockViewModel\r\n1.) Container.GetInstance(IBlockViewModel, {AAOS.OrthoInfo.Epi.Models.Blocks.FeaturedItemBlock=Castle.Proxies.FeaturedItemBlockProxy}) \r\n"} StructureMap.StructureMapConfigurationException
Below is my code:
public StructureMapRegistry() { Settings = new OrthoInfoConventionSettings(); ApplyConventions(); ApplyRegistrations(); }
private void ApplyConventions() { /* Convention that will scan web app's bin folder and register dependencies based on conventions included. */ Scan(_ => { _.AssembliesFromApplicationBaseDirectory(x => x.FullName.StartsWith(Settings.AssemblyScanPrefix) && !Settings.AssembliesToIgnore.Contains(x.GetName().Name)); _.Exclude(x => !x.IsClass || x.IsAbstract || x.IsGenericTypeDefinition); _.With(new OrthoInfoDefaultConvention(Settings)); _.With(new OrthoInfoViewModelConvention(Settings)); }); }
private void ApplyRegistrations() { /* Manual registrations here for types not handled by conventions, such as open generics * NOTE: No need to manually register type if using conventions. * Ex: For().Use(); * Ex: For().Use(); */ For().Use();
Hi,
I have successfully upgraded EPI 10 to 11. Everything worked fine but except one.
This is not exactly related to EPI Upgrade, but related to code.
When I trying to edit FeaturedBlocks from CMS, I get the below error:
+ $exception {"No default instance or named instance 'Default' for requested plugin type IBlockViewModel\r\n1.) , {AAOS.OrthoInfo.Epi.Models.Blocks.FeaturedItemBlock=Castle.Proxies.FeaturedItemBlockProxy})
Container.GetInstance(IBlockViewModel
\r\n"} StructureMap.StructureMapConfigurationException
Below is my code:
public StructureMapRegistry()
{
Settings = new OrthoInfoConventionSettings();
ApplyConventions();
ApplyRegistrations();
}
private readonly OrthoInfoConventionSettings Settings;
private void ApplyConventions()
{
/* Convention that will scan web app's bin folder and register dependencies based on conventions included. */
Scan(_ =>
{
_.AssembliesFromApplicationBaseDirectory(x => x.FullName.StartsWith(Settings.AssemblyScanPrefix) && !Settings.AssembliesToIgnore.Contains(x.GetName().Name));
_.Exclude(x => !x.IsClass || x.IsAbstract || x.IsGenericTypeDefinition);
_.With(new OrthoInfoDefaultConvention(Settings));
_.With(new OrthoInfoViewModelConvention(Settings));
});
}
private void ApplyRegistrations()().Use(); ().Use(); ().Use();
{
/* Manual registrations here for types not handled by conventions, such as open generics
* NOTE: No need to manually register type if using conventions.
* Ex: For
* Ex: For
*/
For
if (Settings.PageViewModelPluginType != null && Settings.PageViewModelBaseType != null)
{
For(Settings.PageViewModelPluginType).Use(Settings.PageViewModelBaseType);
}
if (Settings.BlockViewModelPluginType != null && Settings.BlockViewModelBaseType != null)
{
For(Settings.BlockViewModelPluginType).Use(Settings.BlockViewModelBaseType);
}
}