Web developers wiki ASP.NET Sitecore Sharepoint Kentico by Evident Interactive



ASP.NET 2.0 and Visual Studio 2005



When using the ASP.NET Development Server you may get the following error message when you are using your own implementation of IPrincipal:

Type is not resolved for member 'OPG.DMA.Common.Security.OpgDmaPrincipal,OPG.DMA.Common, Version=, Culture=neutral, PublicKeyToken=null'.

This is problem is caused by the fact that the ASP.NET Development Server uses a slightly different threading model than IIS. The CurrentPrincipal is stored on a thread and for some reason the ASP.NET Development Server sometimes decides to move a thread to another AppDomain which causes this specific error. But fortunately, this does not happen in IIS.



This is a serious problem which can not easily be resolved. At the moment their are only two known workarounds: 1. Put the dll containing the definition of your implementation of Iprincipal in the GAC (Global Assembly Cache). 2. Do not use the ASP.NET Development Server, but use IIS (Internet Information Server) instead.

Using the global assembly cache during developent is very inconvenient. Therefore the recommended solution is to use IIS.


More info

A fairly detailed description of this problem can be found at more info.

 © Evident Interactive BV