Thursday, April 28, 2011

Today I spent hours trying to make one line of code work. Fortunately Miguel Castro was ultimately able to help me troubleshoot the issue thanks to his deep understanding of all things ASP.NET.

The line of code seems so simple:

var data = Roles.GetRolesForUser(“rocky”);

In this case Roles is the RoleProvider API from System.Web.Security, and the method returns a string array with the roles for the user.

This line of code works great in my aspx page. No problem at all.

But in the same web project it throws a NullReferenceException when called from a WCF service (in a svc).

No stack trace. No detail. No nothing. I Binged, and Googled, and created a whole new solution (figuring my first solution was somehow corrupted). But nothing helped.

To cut to the answer, this works in a WCF service:

var data = Roles.Provider.GetRolesForUser(“rocky”);

See the difference? Instead of relying on the static helper method on the Roles type, this code explicitly calls the method on the default provider instance.

(fwiw, I think this behavior is relatively new, because that code used to work. I just don’t remember how long ago it was that it worked – .NET 3 or 3.5 – so perhaps something broke in .NET 4?)

In any case, problem solved – thanks Miguel!!

WCF | Web
Thursday, April 28, 2011 5:46:57 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  | 
 Monday, April 25, 2011

Dunn training will be holding their next CSLA training class in Atlanta, June 21-23.

If you are gearing up to use CSLA .NET and want some solid classroom training to get started, this is the way to go!

Monday, April 25, 2011 8:01:38 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Friday, April 01, 2011

The Minnesota chapter of IASA is holding an IT architect training event in May. Details:

Course Summary:

Foundation Core Skills - The Key Distinguishing Factor for IT Architects

  • Business Technology Strategy - Identified by Iasa members and global thought leaders as the core value proposition of any architect and the key set of skills in our profession, business technology strategy ensures immediate business value from technology strategy. It ensures that your organization will succeed in converting technology and IT from a liability to an asset.

Foundation Supporting Skills

  • Design- Architects commonly use design skills to create solutions to problems identified in developing technology strategy solutions.
  • Quality Attributes - Quality Attributes represent cross-cutting concerns in technology solutions such as Performance, security, manageability, etc that must be considered across the entire enterprise technology strategy space.
  • IT Environment - Technology strategy must include a general knowledge of the IT space including application development, operations, infrastructure, data/information management, quality assurance, and project management. The IT Environment skills prepare an architect for the IT side of a technology strategists job function.
  • Human Dynamics - Much of an architects daily role is working with other stakeholders to understand and define the technology strategy of the organization. The human dynamics skills represent the means for working with others in the organization including situational awareness, politics, communication and leadership.
Friday, April 01, 2011 8:12:16 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |