spring.net

Could not load file or assembly 'Spring.Core, …'

和自甴很熟 提交于 2019-12-11 06:59:43
问题 Below follows the error generated: Server Error in '/' Application. -------------------------------------------------------------------------------- Could not load file or assembly 'Spring.Core, Version=1.3.1.40711, Culture=neutral, PublicKeyToken=65e474d141e25e07' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Description: An unhandled exception occurred during the execution of the current web

Spring.Net & Attribute Injection

陌路散爱 提交于 2019-12-11 04:15:10
问题 I want to dependency inject an attribute in ASP.NET MVC using Spring.Net, my attribute is something like this (note this is all pseudo code I've just typed in)... public class InjectedAttribute : ActionFilterAttribute { private IBusinessLogic businessLogic; public InjectedAttribute(IBusinessLogic businessLogic) { this.businessLogic = businessLogic; } public override void OnActionExecuting(ActionExecutedContext filterContext) { // do something with the business logic businessLogic

IoC (spring.net) with asp.net - ctor injected non-singleton objects on controller - where do I dispose?

拟墨画扇 提交于 2019-12-11 03:46:13
问题 I'm using asp.net MVC 4 - I have spring.net setup to ctor inject objects on construction of my controllers, but some of the objects aren't singletons, so I'm unsure as to how to handle the dispose method on these objects once the controller is disposed. It just feels wrong calling these objects dispose methods in the controller class as the controller class didn't construct these objects, my IoC container did. Any help would be much appreciated. Thank you. 回答1: Consider defining Request scope

spring Net vs enterprise library

[亡魂溺海] 提交于 2019-12-11 03:14:29
问题 I've been searching the web for information about a Net Framework I can use to "take it and keep it" from now on in my projects, and I've almost made a decision, but I would like some reference about what direction the market is moving on. I can't find anything in google about which is the most used, which one have the most future, etc. I've been reading about other Frameworks too (Castle, Nhibernate, CSLA), but these 2 (Spring Net & EntLib) seem to be the more robust to me. Do you have

Using Spring.Net to inject dependencies into ASP.NET MVC ActionFilters

百般思念 提交于 2019-12-11 02:25:06
问题 I'm using MvcContrib to do my Spring.Net ASP.Net MVC controller dependency injection. My dependencies are not being injected into my CustomAttribute action filter. How to I get my dependencies into it? Say you have an ActionFilter that looks like so: public class CustomAttribute : ActionFilterAttribute, ICustomAttribute { private IAwesomeService awesomeService; public CustomAttribute(){} public CustomAttribute(IAwesomeService awesomeService) { this.awesomeService= awesomeService; } public

Spring.net inject dictionary order question?

ε祈祈猫儿з 提交于 2019-12-11 02:19:33
问题 I use spring.net inject a Dictionary<string,string> in this order: <object id="dictLang" type="System.Collections.Generic.Dictionary<string,string>"> <constructor-arg> <dictionary key-type="string" value-type="string" merge="0"> <entry key="zh-CN" value="中文" /> <entry key="en-US" value="英文" /> <entry key="th-TH" value="泰文" /> </dictionary> </constructor-arg> </object> When I use foreach to iterate it, it outputs this: code=en-US,name=英文 code=th-TH,name=泰文 code=zh-CN,name=中文 I found it is

InheritanceBasedAopConfigurer using runtime constructor arguments

自闭症网瘾萝莉.ら 提交于 2019-12-10 11:19:57
问题 I've got a (prototype) class owned by the Spring.NET context, created with an AutoProxy with runtime constructor arguments. It get's instantiated like this. var context = ContextRegistry.GetContext(); var myClass = context.GetObject("myclass", new object[]{ myRuntimeConstructorArgument }) as MyClass; This class has some inner logic going, where it catches an event that gets handled by a class method, like this: // MyClass owned by Spring.NET context public class MyClass { // InnerObject not

When to call Dispose in Entity Framework?

僤鯓⒐⒋嵵緔 提交于 2019-12-08 07:02:25
问题 In my application I am making use of Spring.Net for IoC. The service objects are called from the ASP.Net files to perform CRUD operations using these service object. For example, I have CustomerService to do all CRUD operations on Customer table. I use entity framework and the entities are injected .. my question is where do I call the dispose method? As far as I understood from the API documentations, unless I call Dispose() there is no guaranty it will be garbage collected! So where and how

NHibernate + Spring.NET lazy loading failed - no session

僤鯓⒐⒋嵵緔 提交于 2019-12-08 04:43:23
问题 I use Spring.NET AOP for transaction and session management with NHibernate. When user makes several requests too quick - lazy loading is failed with exception "no session or session was closed". I use SpringSessionContext as CurrentSessionContext in NHibernate configuration public class FluentSessionFactory : LocalSessionFactoryObject { protected override ISessionFactory NewSessionFactory(Configuration config) { var conf = Fluently .Configure() .Database( MsSqlConfiguration .MsSql2008

Is it possible to have a dynamic resource path for import?

安稳与你 提交于 2019-12-08 02:50:00
问题 I have a Spring.NET program with a configuration file. To smooth the transition from test to prod I'd like to have an environment variable that gives the path to a shared config file, and use that to import a resource, however it appears the <import resource="path"/> is not being resolved. For example if I try to load the file <import resource="\\server\share\${computername}\SpringConfig.xml"/> I get a file not found exception as below: System.Configuration.ConfigurationErrorsException: Error