This is easy enough using the CustomPrincipal object in Rocky Lhotka’s CSLA framework (which is also being used). We simply create the CustomPrincipal and add that to the ApplicationContext.
The problem arises when I try to access the Request object. Actually, it’s the Url property of Request. When I try to access it, I get the following error.
Other developers in the shop are running the code without error. What’s especially frustrating about this is that the original error didn’t point to this at all. It talked about a “type not found” error.
I did a bunch of research on the web about it and finally came up with something plausible. It pointed to the fact that the integrated web server in Visual Studio might be the culprit.
Sure enough… I’m using the integrated web server. When I created a site in IIS and switched over to that, I was able to run the code successfully.
It appears to be a known issue that Microsoft won’t be addressing anytime soon.
Thank you for your feedback. We are aware of this issue and are not planning to address this in the ASP.NET Development Server for this release. We will consider this issue again in a future release.