StructureMap Could not load file or assembly
I'm using StructureMap MVC on my WebAPI project.
When I run the unit tests or integration tests, with xUnit and ReSharper
I'm getting:
System.IO.FileNotFoundException
Could not load file or assembly 'MyApi.MyServices, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
system cannot find the path specified.
This occurs randomly on my tests. When I try to run again I don't get this
error.
Here is where the error occurs:
ObjectFactory.Initialize(x =>
{
x.For<IProvider>().LifecycleIs(Lifecycles.GetLifecycle(InstanceScope.PerRequest)).Use<SQLiteProvider>();
x.For<ILog>().LifecycleIs(Lifecycles.GetLifecycle(InstanceScope.Singleton)).Use(Logger.Object);
x.For<ISession>().LifecycleIs(Lifecycles.GetLifecycle(InstanceScope.PerRequest)).Use(()
=> Session);
});
The StackTrace isn't helpful:
at StructureMap.ObjectFactory.Initialize(Action`1 action) in
c:\BuildAgent\work\767273992e840853\src\StructureMap\ObjectFactory.cs:
line 61
No comments:
Post a Comment