views:

1332

answers:

1

I am developing two projects which are both managed by ClearCase, which means that for Windows, it looks like they are located on a network share.

The first project is a DLL written using VS 2003 in managed C++ and is intended to provide a managed interface for some legacy DLLs written in VS2003 C++.

The second project is written in C# (.NET 3.5, VS2008) and includes the DLL generated by the first project as a reference to make use of the legacy DLLs via the wrapper.

Now when I try to start the C# project, I get the following error message:

FileLoadException was unhandled

Could not load file or assembly '(my managed c++ wrapper), Version=(version number), Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.

Looking at the details, this is a System.Io.FileLoadException containing an inner System.UnauthorizedAccessException ("Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"

Now when I copy the C# project to the local hard drive, everything works fine, even if the managed C++ project stays on the network drive.

I've had permission problems with network drives before but these vanished when upgrading to .NET 3.5 SP1. I also tried changing the Permission Set for the All_Code code group to "Full Trust" for .Net Configuration 1.1. and 2.0, as suggested on the internet, but this did not help either. Btw, I also checked if the DLL is readonly, but it isn't.

Thanks in advance for any help!

Update: I also tried signing both assemblies with a Strong Name and giving these keys full trust but to no avail. There must be some other reason but I am out of ideas.

A: 

it sounds like you need to set your Code Access Security Policy to allow this location

http://msdn.microsoft.com/en-us/library/930b76w0(VS.71).aspx

Follow the instructions about 1/3 the way down this article (with screenshots) :-) http://www.15seconds.com/Issue/040121.htm

alex
Thanks for your answer. However, as mentioned in the question, I already tried adjusting the security policy but without success.
Jan