autofac

autofac wcf registration error

流过昼夜 提交于 2019-12-23 07:28:42
问题 I'm trying to attempt a structure with Autofac on Wcf. namespace WcfService1.Model { [DataContract(IsReference = true)] public partial class Account { [DataMember] public int Id { get; set; } [DataMember] public string Name { get; set; } [DataMember] public string Surname { get; set; } [DataMember] public string Email { get; set; } [DataMember] public Nullable<System.DateTime> CreateDate { get; set; } } } Model>IAccounRepository.cs 1. namespace WcfService1.Model { public interface

autofac wcf registration error

耗尽温柔 提交于 2019-12-23 07:28:02
问题 I'm trying to attempt a structure with Autofac on Wcf. namespace WcfService1.Model { [DataContract(IsReference = true)] public partial class Account { [DataMember] public int Id { get; set; } [DataMember] public string Name { get; set; } [DataMember] public string Surname { get; set; } [DataMember] public string Email { get; set; } [DataMember] public Nullable<System.DateTime> CreateDate { get; set; } } } Model>IAccounRepository.cs 1. namespace WcfService1.Model { public interface

Session-per-HttpRequest using Autofac. NHProf showing “multiple Session” warning when not accessing ISession through DependencyResolver

本小妞迷上赌 提交于 2019-12-23 05:05:07
问题 I've successfully implemented Session-per-HttpRequest using Autofac. I'm unhappy with my implementation because I am going through DependencyResolver and not relying on parameters provided by AutoFac. If I rely on the ISession parameter provided by AutoFac, then I receive a warning with NHProf indicating that there are multiple Sessions in use. If I go through DependencyResolver , the warning from NHProf disappears, but the usage feels incorrect to me. I have followed the Autofac + MVC4.0

Using Autofac with AJAX-enabled WCF Service

馋奶兔 提交于 2019-12-23 04:07:20
问题 I am desperately trying to get this to work. I have used WCF services to do AJAX with JQuery before without any hustle. Now I am using Autofac for DI, and so far it is going quiet good, until I want a WCF service in my UI project to be the base for AJAX. In my regular Webapplication I am using Global.asax 'Application_Start' to register my containers. This is done by calling a Boot() method in my 'MyBootstrapper' project. The Boot() method simply registers all my modules. Now I noticed that

Autofac Dependencies Per Area

蹲街弑〆低调 提交于 2019-12-23 02:52:33
问题 I'm creating a new MVC4 site using Autoface that has a public consumer site as well as an admin area for managing the consumer facing site. The admin site will be located in a different area be using the same services as the consumer facing site, but will not having some of the custom branding features. I've followed the advice given elsewhere of having a ViewDataFactory which provides a set of shared data for the view to use. My goal is to provide a different ViewDataFactory depending on

Autofac multithreading issues

亡梦爱人 提交于 2019-12-23 02:29:13
问题 I'm trying to use autofac DI in my application. I created a wrapper class to abstract away all the autofac dlls: FrameworkDependencyResolver : Logger, IFrameworkDependencyResolver In this class I hold the container builder, and register all my dependencies in the application root. After registering my types I build it and hold the container: Icontainer _container; ContainerBuilder _builder public FrameworkDependencyResolver() { _builder = new ContainerBuilder(); } Deep in my application i

Use Autofac with a WCF service using WAS

馋奶兔 提交于 2019-12-23 00:29:06
问题 I like the WCF 4.0 capabality to host a service without an .svc file by setting a serviceActivations in the config file. It work great using the default service factory but now I'm trying to do the same using the AutofaServiceHostFactory so my dependencies will be properly injected. In all scenarios I tried, I still got this error when I try to access to service : The service 'WCFAutofacWiring.MyService' configured for WCF is not registered with the Autofac container . I host my service in an

MVC5 Autofac: The view found at was not created

橙三吉。 提交于 2019-12-22 20:02:46
问题 I created very simple MVC 5.0 application that I push to GitHub repository: https://github.com/marxin/mvc-sample. My motivation is to execute app on Linux with mono 3.2.3. I would like to add Autofac NuGet package (more precisely 3.3.0), that works fine for me. Problem is that if I add Autofac.Mvc5 integration package, Razor stops working with following error: System.InvalidOperationException The view found at '~/Views/Home/Index.cshtml' was not created. Description: HTTP 500.Error processing

Enumerating disposables tracked by an Autofac lifetime

故事扮演 提交于 2019-12-22 13:52:40
问题 Autofac uses lifetime scopes as a way of disposing of all of the components created during a unit of work. While this is a powerful feature, it is easy to write code that doesn't dispose the lifetime scopes properly, which results in the number of tracked disposables growing over time: effectively a memory leak. Is there a way of monitoring the number of Disposable objects being tracked by a Lifetime Scope at any point in time. I'm interested in writing tool to help me find issues related to

Enumerating disposables tracked by an Autofac lifetime

吃可爱长大的小学妹 提交于 2019-12-22 13:52:01
问题 Autofac uses lifetime scopes as a way of disposing of all of the components created during a unit of work. While this is a powerful feature, it is easy to write code that doesn't dispose the lifetime scopes properly, which results in the number of tracked disposables growing over time: effectively a memory leak. Is there a way of monitoring the number of Disposable objects being tracked by a Lifetime Scope at any point in time. I'm interested in writing tool to help me find issues related to