structuremap3

    5热度

    1回答

    我已经升级到SM 3.0,现在,除了其他重大更改外,我发现EqualToAppSetting已消失。 我曾经是能够做到 .Use<SomeType>().Ctor<SomeType>("connectionStr").EqualToAppSetting("myAppSetting"); 其中当然myAppSetting是从在app.config或web.config中拉出。 现在有谁知道该怎么

    1热度

    1回答

    我想打电话从控制器/ ServiceAssembly 目前我客户的方法我使用 //Notify Others of the Login GlobalHost.ConnectionManager.GetHubContext<NotificationHub>().Clients.All.NotifyOthersAllOnLogin(string.Format("Recent Login({2}):

    3热度

    2回答

    我有以下的StructureMap注册工作在版本2.6.4,我终于升级到最新的SM(本文撰写时为3.1.2)。并且需要更新它,因为不再有IContext.BuildStack。 这里是旧的工作版本2.6.4: initialization.For(typeof(IRepository<,>)) .Use(context => {

    14热度

    1回答

    我有一个使用Structuremap的ASP MVC 4应用程序。我试图通过结构图拦截将日志记录添加到我的应用程序中。 在注册表,我扫描特定的组件,以便使用默认的惯例注册所有它的类型: public class ServicesRegistry : Registry { public ServicesRegistry() { Scan(x => {

    0热度

    3回答

    我有一个名为MyClass的类,它使用两个不同的记录器,名为Logger1和Logger2。我使用log4net进行记录,并且想要使用StructureMap for DI。 没有StructureMap,我的课是这样的: public class MyClass { private static readonly ILog Logger1 = LogManager.GetLogger

    0热度

    2回答

    我有一个这样的结构项目: 数据层 - 对于模型 MVC网站 - 所有其他mvc网站相关。 我希望我的控制器同时注入数据库上下文和服务,并且仍然确保依赖注入。 这里是我的代码 我的控制器: private CMSDB _db; public HomeController(CMSDB db) { _db = db; } 我的数据库上下文 public cl

    1热度

    1回答

    当我使用WCF和StructureMap时遇到了这个奇怪的错误。 我也试图寻找堆栈,有一些答案是建议安装修补程序:Operation could destabilize the runtime in StructureMap 但我不能因为修补程序安装到"Software Update KB2748645 Installation Wizard does not apply, or is block

    0热度

    1回答

    尝试升级/ 2.6 转换为StructureMap 3.0我有通过With方法手工设置构造函数的参数关闭的ObjectFactory ObjectFactory.With(ctorArgument).GetInstance<ClassThatHasACtorArgument>(); 什么现在是StructureMap 3.0当量的代码?

    0热度

    1回答

    在我的应用程序配置structuremap像 public class DefaultRegistry : Registry { #region Constructors and Destructors public DefaultRegistry() { Scan( scan => { scan.Assembly("Eter

    3热度

    2回答

    我们最近升级了网络/ MVC应用程序使用StrucutreMap 3.0.4 现在用蚂蚁探查时“操作可能会破坏运行”,试图剖析使用展鹏Ant的探查器的应用程序时在“线路电平计时,与来源所有方法”或更高的水平,我们得到以下错误 Operation could destabilize the runtime. Description: An unhandled exception occurred