views:

139

answers:

4

Okay,

We have a .NET WinForms application that has several .NET dll's it depends on, running on an XP machine, that is connected to a network in a large domain.

A little story, that defines the problem.

We deployed this application on a customers machine while logged in as an admin and all worked fine.

We then logged into a lower privalaged account, and low and behold the application failed to start, but that was expected.

so we got their IT department to make the folder Read/Write access (as we use folders in there for holding temp files) and they allowed the .exe to be executable by that user.

Now starting the executable, the application runs (yay) but then we got it to perform an action that required code in one of it dependant (managed) dll's...

An Exeception is thrown, stating "The assembly "xxxx.dll" failed to load (access is denied)" I am assured by their IT department that the dll's have the same file permissions as the main executable (and by quick look at what the lower privilege user can see of security settings, it did appear that way) and they were not set as "blocked" as XP sometimes does.

So the question is more of a fish for possible ideas that may be causing this...

EDIT: Turns out it was file permissions that were the problem and that the IT department in question hadn't followed through checking that permissions had been applied to all child objects. As I can't accept all 4 of your answers for such good ideas I have given you all an up vote.

+1  A: 

The user may have access to the DLL listed in the error message but do they have access to all of the DLLs that that DLL needs? Check out something like Dependency Walker to find any DLLs that might be required.

TLiebe
I also thought this, but any DLL's, besides the standard windows DLL's .NET ties into, are all located in the apps directory.
Sekhat
+1  A: 

Several possible problems, some detailed here: http://msdn.microsoft.com/en-us/library/ab4eace3.aspx

You may be asking to load an assembly that makes security demands that are larger than your main application. (Requesting permissions: http://msdn.microsoft.com/en-us/library/yd267cce.aspx )

If you are running full trust this is unlikely, but if the DLL you are loading is on the network make sure you have that location trusted by .NET: (trusting a share: http://blogs.msdn.com/shawnfa/archive/2004/12/30/344554.aspx )

Godeke
+1  A: 

Does the DLL access the registry or some other system folder that the lower privilege user isn't allowed to access? What is it trying to do when the error occurs?

You could also check whether the domain has some kind of group policy that's interfering with what the DLL is trying to do.

Chris Tybur
as far as I'm aware no. It's the assembly itself that's failing to load anyway, the JIT compiler throws an assembly load exception as opposed to the assembly itself throwing an error..As for the group policy, I thought of that too, but I have to get their IT department to really investigate it.
Sekhat
+1  A: 

.NET doesn't trust assemblies from non-local drives by default.

See http://msdn.microsoft.com/en-us/library/zdc263t0.aspx for instructions to allow specific network locations to be trusted.

Phil Ross
it is local I'm afraid :(
Sekhat