古い構造マップから新しい構造マップに変換中です.. 2. 何かから 3.1.6.186...
IWebAccess のデフォルト インスタンスを WinFormAccess として定義しようとしています...実行すると、次のエラーが発生します。
セットアップ: StructureMap.StructureMapConfigurationException: デフォルトのインスタンスが登録されておらず、タイプ 'JCDCTools.Core.Utilities.Interfaces.IWebAccess' に対して自動的に決定できません
JCDCTools.Core.Utilities.Interfaces.IWebAccess の構成が指定されていません
1.) Container.GetInstance(JCDCTools.Core.Utilities.Interfaces.IWebAccess)
c:\BuildAgent\work\a395dbde6b793293\src\StructureMap\SessionCache.cs の StructureMap.SessionCache.GetDefault(Type pluginType, IPipelineGraph pipelineGraph) で: c:\BuildAgent\work の StructureMap.Container.GetInstance(Type pluginType) で 63 行目\a395dbde6b793293\src\StructureMap\Container.cs: c:\BuildAgent\work\a395dbde6b793293\src\StructureMap\Container.cs の StructureMap.Container.GetInstance() の 339 行目: _Test_DAL.BaseTest.TestFixtureSetup() の 202 行目BaseTest.cs: 22 行目
これが私のコードです
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>();
}
私はググって掘り下げましたが、For.useがデフォルトのインスタンスを作成していない理由がわかりません...単純に見えましたが、これを機能させることができません..
誰かが私が間違っていることを理解するのを手伝ってくれますか? コード例、または Github の公式ドキュメントよりも詳しく説明されているドキュメント ( http://structuremap.github.io. )