views:

425

answers:

4

I have a Delphi 5 executable that calls into a .NET assembly via the free Delphi .NET code, and for the most part, this works great. However, one of the requirements of my application is that our clients be able to use this from a networked share as well as local. On my test machine, I can't get this to work, I just get an error message. The .NET code has it's permissions set to full, but some error comes back that Delphi can't seem to get or interpret. On a local drive, the application and assembly communicate flawlessly.

Can anyone tell me how to at least get the error messages back from this? Or if possible, can anyone tell me why I would get errors this way? Thanks.

+2  A: 

You say that you have given the code full permissions, but have you assigned FullTrust to the network share? In .NET, network shares are part of the local intranet domain, so you lose some trust. Run something like;

CasPol.exe -m -ag 1.2 -url file://\\ShawnFa-Srv/Tools/* FullTrust

For more info see this post about the topic, Using CasPol to Fully Trust a Share

Rob Prouse
A: 

Yes, I have given Full Trust to the share. That's what I meant by full permissions, I'm too used to having to explain it to non-technical people.

Tom
+2  A: 

Update to .NET 3.5 SP 1. That removes the distinction between files on the local intranet and local HDDs WRT code access security (including for 2.0 assemblies).

Craig Stuntz
A: 

Ok, I've found the answer in re-visiting the differences between CasPol and the .NET Framework Configuration Utility (utility), as well as how each of these is working. This may be a bit long as I'm typing it out here for myself as well as others who have the same issue and don't complete the process (like I didn't at first).

When I first tried CasPol, and then the utility, I didn't realize that I a needed to enter the new record into an existing "zone" section and tried to enter it as a new section under the main "All Code" section. Moving it to the Intranet Zone let the code run.

The other place I had tried, installing the .NET Framework 3.5, failed as I missed that I wasn't installing SP1. Installing SP1 to a test machine also fixed the issue. This method is what my boss decided we want to use as it minimizes the interaction between us and our client's it personnel.

Thanks to both of you for your help. I appreciate the time.

Tom