views:

258

answers:

1

Ok, so here is the deal. I have this project called Import.exe. It will look for a file, parse it and use Castle AR to import. This runs great at the command line.

Now that same Import.exe needs to be ran from and VB.NET web program after a file Upload. I am using System.Debug.Process.Start to call the exe. The file uploads fine, the program runs (i see it in the task manager for a few seconds) and I have redirected the Error output and it is giving me this:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Castle.ActiveRecord, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. Access is denied.

I have the dll's in the same folder as the exe's. I have added those to the GAC, and I have even added the assembly references to the websites web.config file.

Now, since I come from the Linux/Ruby Camp, I am in very foreign territory and have exhausted all my resources. Any help would be greatly appreciated! Heck, even explanations or links to good references for learning about the differences of assemblies from Command Line vs VB.NET would be great.

+1  A: 

The .NET Framework has some fairly restrictive default security settings for the web side. I'm guessing that you will need to grant some more permissive trust settings to your calling program.

There's a little sample program at MSDN that you might try launching from your web program (instead of your Import.exe) to see what kind of access you are granted by default.

Once you understand what kind of trust your particular application needs, you can follow these steps to modify the trust level of your called assembly.

Good luck! The transition from Linux to Windows can be particularly painful :)

Mike