Archive for December, 2008

COMException- Unsupported type for field or property setter

I need a custom role based security for our project. It should be based on resources and resources’ permissions. All resources are somehow objects.
Firstly, I’ve implemented custom principal inherited from GenericPrincipal class, custom permission that implements IPermission and IUnrestrictedPermission. And than as it is expected I implement my realization of CodeAccessSecurityAttribute in order to [...]

FormsAuthentication.Encrypt(ticket) returns null

I’ve done a sample today and I need to create FormsAuthenticationTicket manually in order to make it inexpiable. I create specifying null for user data in the constructor.

1: FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, FormsAuthentication.FormsCookieName,
2: DateTime.Now, expiredTime, persist, null, FormsAuthentication.FormsCookiePath);
3: 
[...]

Access an web service from web application with different default credentials

Today, a developer from the team asked me how to access a web service in our domain with user default credentials but for different user that those in WindowsIdentity.GetCurrent().
Let’s say that there is a web site that is configured to use Windows authentication in ISS and in the web configuration file we have Windows authentication [...]

My new blog at blog.windowsclient.net

Since today I have a new blog at http://blogs.windowsclient.net/tbbtuk/default.aspx. I’d like to improve myself in the area of WPF and I’ll post all connected with WinForms and WPF there. I’ll also continue to blog here in my personal blog.
The idea to have an additional blog especially for WPF and WinForms came to me in the [...]

Execute unit tests against DB and keep it unchanged using AOP

Few weeks ago, I wrote about how to extend Nunit to support RollBack attribute and how to execute unit tests against database and keep it unchanged.
Today, I’ve tried to achieve the same functionality but using AOP. Actually, I’ll use PostSharp platform in order to weave needed code in each test method decoreted with RollBackAttribute. PostSharp [...]