I have a routine that allows someone else to log-on to the application at a different workstation for the purpose of allowing the user to complete a task according to the company business rules or recieve training. On the impersonation is complete it retrieves user information from the database and this is where my error message is
I have tested the log-on / impersonation with 3 different user id's on the same machine and get 3 different errors. All of the people that I have tested with all have the correct database access / privileges
1. Logon as me it works as expected and if I logon with another 3 different accounts it works.
2. Logon as my boss PeterD and I get
Specified cast is not valid.
from my LinQ to SQL statement
'Users is a function that returns the LINQ to SQL table
'LogonName is a variable that hold the username i.e. SimonW / PeterD / DuncanB
Dim q = (From U As Tables.Users In Users() Where U.LogonName = logonName Select U).ToList
3. Logon as a colleague and I get the following error
Could not load file or assembly 'Oak.DataLayer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.
Some blogs have sugessted that I give permissions to the
C:\Documents and Settings\SimonW\Local Settings\Apps\2.0
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
but they haven't been successful.
UPDATE
I have only one problem left in this question, that IS why would one username cause it not to find a dll that the application has reference too?
I solved number 2 by creating a fresh LINQ to SQL table class.
Thanks
Simon