I am using a signed version of structuemap 4.5.3 in a webapi 2.0 project.
I am getting the following compile error on the following piece of code.
For<ISpaceRadarDbContext>()
.HttpContextScoped()
.Use(c => new SpaceRadarDbContext());
The error below saids something 'CreatePluginFamilyExpression<>' is defined in an assembly that is not referenced
How do Fix this?
using SpaceRadar.Context;
using SpaceRadar.Repositories;
using SpaceWeather.Log;
using StructureMap;
using StructureMap.Web;
namespace SpaceRadar.Web.Api.DependencyResolution
{
public class LogRegistry : Registry
{
public LogRegistry()
{
For<ISpaceWeatherLogService>().AlwaysUnique().Use(s => s.ParentType == null ? new SpaceWeatherLogService(s.GetType()) : new SpaceWeatherLogService(s.ParentType));
For<ISpaceRadarDbContext>()
.HttpContextScoped()
.Use(c => new SpaceRadarDbContext());
}
}
Severity Code Description Project File Line Suppression State
Error CS0012 The type 'CreatePluginFamilyExpression<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'StructureMap, Version=4.0.0.315, Culture=neutral, PublicKeyToken=null'. SpaceRadar.Web.Api C:\spaceradarweb\spaceradarweb\SpaceRadar\SpaceRadar\src\SpaceRadar.Web.Api\DependencyResolution\LogRegistry.cs 14 Active
Error CS0012 The type 'GenericFamilyExpression' is defined in an assembly that is not referenced. You must add a reference to assembly 'StructureMap, Version=4.0.0.315, Culture=neutral, PublicKeyToken=null'. SpaceRadar.Web.Api C:\spaceradarweb\spaceradarweb\SpaceRadar\SpaceRadar\src\SpaceRadar.Web.Api\DependencyResolution\LogRegistry.cs 14 Active
--
You received this message because you are subscribed to the Google Groups "structuremap-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structuremap-us...@googlegroups.com.
To post to this group, send email to structure...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/structuremap-users/b2a31d2b-2e72-457c-a6e8-fae8716cfea6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Untitled.png>