Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 13-Dec-11 23:17pm
v2

1 solution

Solved the last problem it was a permissions issue on my local machine. I had to give permissions to the user(s) for read / write permissions on the project folder.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900