在网络路径 MEF 上创建 DirectoryCatalog 时出现 DirectoryNotFound 错误
我有一个我想坐在服务器上的程序,但我希望用户能够使用Windows Explorer从本地计算机浏览程序并在客户端内存中执行程序。
这很好。包含MEF使用的所有插件的文件夹都在服务器上,因此当客户端在客户端机器内存中运行时,我无法使用本地路径进入文件夹。
我已经尝试了以下代码
catalog.Catalogs.Add(new DirectoryCatalog(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)));
the path.getDirectoryName(assembly.getExecutingAssembly()。位置)返回\ xrp-server \ ashservice \ ashService \ framework \ framework \ client \ client \ plugins,这是插件存储的位置。
当我尝试运行我的客户端程序时,它就崩溃了。检查事件查看器后,我发现 System.IO.DirectoryNotFoundException 未处理。
任何建议将不胜感激。
亲切的问候
阿什
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
修复了它....这是这里所述的另一篇文章,您需要
在加载程序集的程序的配置中包括。
Fixed it.... It was as another post on here said and you need to include
in the config of the program that is loading the assemblies.