I'm convering from old structure map to a new one.. 2. something to 3.1.6.186...
I'm trying to define a default instance for IWebAccess as WinFormAccess...when run it I get this error:
SetUp : StructureMap.StructureMapConfigurationException : No default Instance is registered and cannot be automatically determined for type 'JCDCTools.Core.Utilities.Interfaces.IWebAccess'
There is no configuration specified for JCDCTools.Core.Utilities.Interfaces.IWebAccess
1.) Container.GetInstance(JCDCTools.Core.Utilities.Interfaces.IWebAccess)
at StructureMap.SessionCache.GetDefault(Type pluginType, IPipelineGraph pipelineGraph) in c:\BuildAgent\work\a395dbde6b793293\src\StructureMap\SessionCache.cs: line 63 at StructureMap.Container.GetInstance(Type pluginType) in c:\BuildAgent\work\a395dbde6b793293\src\StructureMap\Container.cs: line 339 at StructureMap.Container.GetInstance() in c:\BuildAgent\work\a395dbde6b793293\src\StructureMap\Container.cs: line 202 at _Test_DAL.BaseTest.TestFixtureSetup() in BaseTest.cs: line 22
Here is my code
public DefaultRegistry()
{
Scan(
scan =>
{
scan.AssemblyContainingType<IWebAccess>(); // JCDCTools.Core
scan.LookForRegistries();
scan.WithDefaultConventions();
});
For<IWebAccess>()
.LifecycleIs<HybridLifecycle>() //why isn't this creating a default instance?
.Use<WinFormAccess>();
}
I've googled and dug, and I dont' get why For.use isn't creating a default instance... it looked simple,but I can't get this working..
Can anyone help me understand what I'm doing wrong? either code examples, or documentation that explains better than the official docs on Github (http://structuremap.github.io.)