Skip to content

Instantly share code, notes, and snippets.

@hyrmn
Created March 30, 2011 14:53
Show Gist options
  • Save hyrmn/894547 to your computer and use it in GitHub Desktop.
Save hyrmn/894547 to your computer and use it in GitHub Desktop.
public class HyrmnBlogApplication : TurbineApplication
{
public override void Startup()
{
ServiceLocatorManager.SetLocatorProvider(() => new StructureMapServiceLocator(ObjectFactory.Container));
base.Startup();
}
protected override void ShutdownContext()
{
CurrentContext = null;
ServiceLocator = null;
}
protected void Application_EndRequest()
{
ObjectFactory.ReleaseAndDisposeAllHttpScopedObjects();
}
}
StructureMap Exception Code: 202
No Default Instance defined for PluginFamily Spark.ISparkSettings, Spark, Version=1.5.0.0, Culture=neutral, PublicKeyToken=7f8549eed921a12c
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: StructureMap.StructureMapException: StructureMap Exception Code: 202
No Default Instance defined for PluginFamily Spark.ISparkSettings, Spark, Version=1.5.0.0, Culture=neutral, PublicKeyToken=7f8549eed921a12c
public class SparkBlade : Blade
{
public override void Spin(IRotorContext context)
{
ViewEngines.Engines.Clear();
var sparkServiceContainer = SparkEngineStarter.CreateContainer();
sparkServiceContainer.AddFilter(new SparkAreasDescriptorFilter());
SparkEngineStarter.RegisterViewEngine(sparkServiceContainer);
var settings = ConfigurationManager.GetSection("spark") as ISparkSettings;
context.ServiceLocator.Register(settings);
}
}
@hyrmn
Copy link
Author

hyrmn commented Mar 30, 2011 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment