CSLA 4.0 - Required DLLs for an MVC website

CSLA 4.0 - Required DLLs for an MVC website

Old forum URL: forums.lhotka.net/forums/t/9421.aspx


j0552 posted on Monday, August 23, 2010

Hi

 

I'm not sure if this behaviour is by design or a minor bug. If I have an MVC website using authentication it seems I must have Csla.Web referenced for it to work correctly.

 

My website compiles with or without the assembly but after compiling without it looks like setting the ApplicationContext.User doesn't set the underlying HttpContext.User object. e.g. if I add this after authentication I get true and false respectively.

 

 Debug.WriteLine(Csla.ApplicationContext.User.IsInRole("Administrator"), "Csla.ApplicationContext.User.IsInRole"); // true

Debug.WriteLine(User.IsInRole("Administrator"), "HttpApplication.User.IsInRole"); // false

 

Seems a bit odd. Is this to be expected?

 

Thanks

Andrew

RockfordLhotka replied on Monday, August 23, 2010

When building applications in ASP.NET you should reference:

When building ASP.NET MVC applications you should additionally reference:

Csla.Web.dll contains some important ASP.NET support, including web-specific behaviors for ApplicationContext.

RockfordLhotka replied on Monday, August 23, 2010

You should also be aware that there's a bug in the ApplicationContext implementation in 4.0.0 that is fixed in 4.0.1. This bug should only affect you in a couple scenarios:

If you encounter issues, try using 4.0.1, as it fixes the bug.

j0552 replied on Monday, August 23, 2010

Thank you for the clarification Rocky.

Andrew

Copyright (c) Marimer LLC