user589195
user589195

Reputation: 4240

DirectoryNotFound error when creating a DirectoryCatalog on a network path MEF

I have a program that I want to sit on a server but I want a user to be able to browse to the program from there local machine using windows explorer and execute the program in the clients memory.

This is working fine. The problem that the folder containing all the plugins used by MEF are on the server so when the client is running in the client machines memory, I cannot use a local path to get to the folder.

I have tried the following code

catalog.Catalogs.Add(new DirectoryCatalog(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)));

the Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) returns \xrp-server\AshService\Framework\Client\Plugins which is the location of the plugin store.

When I try running my client program It just bombs out. After checking the event viewer I see that a System.IO.DirectoryNotFoundException was unhandled.

Any advice would be greatly appreciated.

Kind Regards

Ash

Upvotes: 1

Views: 400

Answers (1)

user589195
user589195

Reputation: 4240

Fixed it.... It was as another post on here said and you need to include

<runtime>
    <loadFromRemoteSources enabled="true"/>
  </runtime>

in the config of the program that is loading the assemblies.

Upvotes: 1

Related Questions