Try our conversational search powered by Generative AI!

EPiServer 11 Upgrade -- No default instance or named instance 'Default' for requested plugin type IBlockViewModel<FeaturedItemBlock>

Vote:
 

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.)
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 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()
{
/* 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();

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);
}
}

#194989
Jul 10, 2018 17:42
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.