Please I need help one more time.
I needed to make some changes and additions to my Identity class and I thought everything was ok.
I need to add 2 properties to the identity and those properties will be set by the UI during login process. So I changed from ReadOnlyBase to BussinessBase class. Also I added some readonly properties.
Following are some details of my Identity class, in italics my additions or changes:
Public Class GTIdentity
Inherits BusinessBase(Of GTIdentity)
#Region " Bussines Methods "
Protected Overrides Function GetIdValue() As Object
Private _id As Guid = Guid.Empty
Public ReadOnly Property Id() As Guid
Private _lastname As String = ""
Public ReadOnly Property Lastname() As String
Private Shared pIdOffice As PropertyInfo(Of Guid) = RegisterProperty(New PropertyInfo(Of Guid)("IdOffice", My.Resources.GTIdentity.pOfficeName))
'some code here to declare GET&SET
#Region " IsInRole "
Private _roles As New List(Of String)
Friend Function IsInRole (ByVal role As String) As Boolean
Public Sub LoadRoles()
'some code here because I load the roles and fill the role list after knowing in which office the user is going to log in.
For Each p In roles
' Office list to provide the UI developer
Private Structure OfficeDetails
Dim _id As Guid
Dim _name As String
Private _Offices As New List(Of OfficeDetails)
#Region " Data access "
Private Sub Fetch(ByVal user As IMultipleResults)
'here I fetch the user details and his list of office he can log in. This is a sub wich is called from both DataPortal_Fetch methods.
My Principal class has no changes and when I tried to run VS threw a TypeInitializationException of type 'GT.Library.Security.GTIdentity' was unhandled by the user. It was in the Principal.Logout, exactly in this line:
Dim identity As GTIdentity = GTIdentity.UnauthenticatedIdentity()
Could somebody explain that to me?
Thanks in advance,
I have some news about this problem. I got into the error window and took a look to error message and it said something about the resources and culture.
Know what? I was using a resx file in the Identity class, in that file I had just text. I removed the reference to theese texts and the problem went away.
Does anybody know why those references to the resources caused that unhandled exception?
Which make the Identity class different from the others?
Copyright (c) Marimer LLC