Here's my registry:
public class MyRegistry : Registory
{
}
Here's my registry:
public class MyRegistry : Registry
{
public MyRegistry()
{
Scan(config =>
{
config.TheCallingAssembly();
config.AddAllTypesOf<IMyType>().NameBy(t =>
t.FullName);
});
}
}
And here's how I'm trying to access it:
foreach(var myType in ObjectFactory.GetAllInstances<IMyType>()
{
...
The exception happens when trying to iterate on the first item in the
collection.
Here's the relevant stack trace:
[StructureMapException: StructureMap Exception Code: 202
No Default Instance defined for PluginFamily
Rrc.Core.Data.Filters.IActiveUserVisibleDataFilter, Rrc.Core.Data,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]
StructureMap.BuildSession.<.ctor>b__0(Type t) +239
StructureMap.Util.Cache`2.get_Item(KEY key) +224
StructureMap.BuildSession.CreateInstance(Type pluginType) +16
StructureMap.BuildSession.GetInstance() +48
StructureMap.BuildSession.<GetAllInstances>b__8(Instance x) +63
Am I doing something wrong here?
Sorry for the confusion. I was trying to show a simple example of
what is happening.
On Feb 10, 5:08 pm, "Jeremy D. Miller" <jeremydmil...@yahoo.com>
wrote:
> Have you registered a default for .IActiveUserVisibleDataFilter? One of your concrete types of IMyType apparently depends on IActiveUserVisibleDataFilter it its constructor.
>
> Jeremy D. Miller
> The Shade Tree Developer
> jeremydmil...@yahoo.com
>
> ________________________________
> From: roend <roen...@gmail.com>
> To unsubscribe from this group, send email to structuremap-us...@googlegroups.com.
On Feb 10, 6:27 pm, "Jeremy D. Miller" <jeremydmil...@yahoo.com>
wrote:
> Do you have some concrete type of IActiveUserVisibleDataFilter that takes in another IActiveUserVisibleDataFilter object as a parameter?
>
> You're getting that error because *something* in your container registration that's that interface or a child of that interface has a dependency on IActiveUserVisibleDataFilter and StructureMap doesn't know which one is the *default* for that interface.
>
> Jeremy D. Miller
> The Shade Tree Developer
> > To unsubscribe from this group, send email to structuremap-us...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/structuremap-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "structuremap-users" group.
> To post to this group, send email to structure...@googlegroups.com.
> To unsubscribe from this group, send email to structuremap-us...@googlegroups.com.