在fitnesse装置中动态加载dll

发布于 2024-07-16 03:08:36 字数 382 浏览 4 评论 0原文

我正在尝试针对接口(在 c# 中)编写 FitNesse 固定装置。 我希望能够让夹具从 dll 动态加载实现(这样我就可以对同一接口的不同实现使用相同的测试……即模拟数据、实时数据等)。 我的装置中有一个 init 方法,它需要 2 个字符串、一个类名和一个 dll 名称。 我在方法中调用 Assembly.LoadFrom(dllname) 。 我在该调用中收到以下错误:“URL 上的目录无效”。

有任何想法吗? 听起来 dll 名称在翻译中不知何故被破坏了......

表格如下所示: |从 Dll 初始化提供程序|SlmLicenseDataErrorProvider|TestModelProvider.dll|

预先感谢...-

罗伯特

I'm trying to write a FitNesse fixture against an interface (in c#). I want to be able to have the fixture dynamically load the implementation from a dll (so that I can use the same tests against different implementations of the same interface...i.e. mock data, live data, etc.). I have a init method in my fixture that takes 2 strings, a class name and a dll name. I call Assembly.LoadFrom(dllname) in the method. I get the following error with that call: "Invalid Directory on URL".

Any ideas? It sounds like the dll name is getting mangled somehow in the translation...

The table looks like this:
|Init Provider From Dll|SlmLicenseDataErrorProvider|TestModelProvider.dll|

Thanks in advance...

-Robert

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

山有枢 2024-07-23 03:08:36

您可能需要在某处添加 !path 以指向程序集的位置。 默认情况下,Fitnesse.Net(或 FitSharp,或现在的任何东西)通常将其工作目录默认为 FitServer.exe 可执行文件(或 SlimServer.exe 或现在的任何东西)的位置。 如果您的程序集不在该目录中,或者在默认程序集搜索路径或 GAC 中,那么fitnesse可能根本找不到它?

You may want to add a !path somewhere to point to the location of your assemblies. By default Fitnesse.Net (or FitSharp, or whatever it is these days) usually defaults its working directory to the location of the FitServer.exe executable (or SlimServer.exe or whatever it is these days). If your assembly isn't in that directory, or in the default assembly search paths or the GAC then fitnesse may simply not be finding it?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文