spring.net

Should I use Spring.Net AOP Throws advice?

Background I have a component that provides certain CRM services - specificCRM. I have a specificCRMAdapter which implements my IGeneralCRM interface. Another component generalCRM exposes CRM functionality through IGeneralCRM and uses Spring.Net to inject the specificCRMAdapter to provide such funtionality. Question I want to be abl...

Seting up configuration for Spring.Net and Rhino Mocks for static GenerateMock<>

I am having trouble setting up the configuration of Spring.Net so that I can use Rhino Mocks to generate a mock object. I realise that GenerateMock is a static method and so I need to use the factory-method in the config, but I just can't get it to work. This is the configuration I am using:   <object id="exampleObject"    type...

How do I specify typeAliases and objects in an external Spring.NET configuration file

SOLVED!!!! Thanks for your help I'm kinda lost here, I'd like to remove all the Spring.NET configuration outside Web.Config but I cant figure out how to put my typeAliases. I'll appreciate all the help you can give me. Thanks. ...

Spring: Remove singleton

I am unit testing a class that calls ContextRegistry.GetContext().GetObject("ISomething") and it's ok if an ISomething isn't defined. So I am trying to test it both ways. Since this definition normally comes from the app.config file and I don't want to edit that file between tests, I'm using [TestFixtureSetUp] and [TestFixtureTearDow...

Importing Spring object definitions

I am trying to share Spring object definitions between a web application, unit testing, and possibly a console app. I would like to define the object definitions in one place and import them. My first pass was to place 'entities.xml' in the same folder as web.config but the relative paths aren't what I expect: <context> <resource uri...

Using Interceptors with NHibernate, Spring.NET, Open Session In View

I'm trying to implement a simple interceptor that will automatically apply a CreateDate/UpdateDate values when an object is created or updated. I've scoured the documentation and forums at NHibernate, and I'm left wondering if there is an open bug with Spring.NET/Open Session in View. Looking at this forum thread, it appears that even ...

Spring.NET & Alternatives

Is Spring.NET a good framework to use in web development? Are there alternatives? Update (for Frederik): Are there drawbacks when using Spring.NET (or IoC container) in Web Development. I always used spring.actionscript in client side flex applications, but client applications aren't the same as Web Applications. Is there a Microsoft...

Spring.Net logging with Log4Net not working

I'm having trouble getting Spring.Net to log, using Log4Net. I'm particulary interested in seeing logging around the Aspects. I'm using a pretty simple log config, similar to that of the MovieFinder example app: ... <logger name="Spring"> <level value="DEBUG" /> <!-- Have tried INFO as well, no different --> <appender-ref ref="Sprin...

Spring.NET & Constructor Interceptors

I'm trying to do some AOP over objects at construction time, and found IConstructorInterceptor, which would be perfect for what I want but it doesn't appear to work (in version 1.2 at least). I've also looked at both the IObjectPostProcessor & the IInstantiationAwareObjectPostProcessor, but I can't find any way to do processing on an ob...

Why am I getting an exception raised from Spring.NET on the call to ContextRegistry.GetContext()?

Even though the solution is so obvious I should have never have posted this, I'm leaving it up as a reminder and a useful point of reference to others. I've got the following in my app.config file: <sectionGroup name="spring"> <section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/> <section name="o...

Contextual Binding with Spring.net

In other IoC containers like ninject you can setup contextual binding pretty easily. I was wondering if contextual binding was supported by the Spring.net IoC container? ...

xVal validation with Spring.net

I have started to play with xVal as my validation framework for an ASP.Net MVC application. I use the Spring.Net IoC container to hold the app together. I have followed the instructions on Steve Sanderson's blog to get server side validation working fine. But when I try to get client side working, I get the following runtime exception:...

Creating new Objects With SPRING.Net

hi I'm new on spring.net, and I'm tring to create an List<> of objects. The list is initialized by a loop that calls: IObj obj= (IObj)ContextRegistry.GetContext().GetObject("obj") change object properties.... add it to the list... the problem is : I keep getting the same object every step of the loop so I get a list of the same obj...

Applying Spring .Net Advice to HibernateTemplate object

I have an class for auditing: public class AuditAfterAdvise : IAfterReturningAdvice This is applied to a Dao class in my Spring.Net configuration, using a RegularExpressionMethodPointcutAdvisor. The Dao class implementation calls HibernateTemplate.SaveOrUpdate(object entity) to commit changes. I would like to be able to apply AuditA...

Asp.net MVC spring bootstrapper

Hi, I am trying to create a bootstrapper with a tasks (for now RegisterRoutes and RegisterControllerFactory) defined in a Spring.Net container. The bootstrapper code is below: public static void Run() { IApplicationContext applicationContext = WebApplicationContext.GetRootContext(); IDictionary bootstrapperTasks ...

Does spring.net recurse sub directories?

When the spring.net framework starts up for an asp.net application does the component that registers all objects in the IoC container recurse all sub-directories referenced in the web.config? eg. <spring> <context> <resource uri="~/bin/ClientService/ClientService.config"/> <resource uri="~/MCFModule.config"/> </context> </s...

Spring.NET Validation Framework setup with ASP.NET MVC

I'm starting a new project for work, and I decided I want to give MVC a shot. It's a small internal site for a commute challenge. I want to use Spring.NET for Validation. I have used Spring.NET before in Web Forms, but with no code behind as in traditional ASP.NET, how do I use the Page Validation framework Spring.NET provides? Edi...

Seting up NHibernate Validator with Spring.net

How can I setup NHibernate Validator with Spring.net as IoC? I am already using Spring.net integration with NHibernate and can't get AutoRegisterListeners to work. What I need is to setup NHV to validate entities automatically upon Update/Save instead of having to call Validate method every time and use Spring.net with ISharedEnginePr...

IoC, AOP and more

What is an IoC container? What is an IoC/DI framework? Why do we need a framework for IoC/DI? Is there any relationship between IoC/DI and AOP? What is Spring.net/ninject with respect to IoC and AOP? ...

Spring.net

How do you set a value of an xml property? This is what I've tried with no succes: <property name="Resources" value="&#60;resources/&#62;"/> Resources is an XmlDocument field. ...