如何从 FitNesse 调用 WCF 服务

发布于 2024-07-15 10:13:45 字数 250 浏览 7 评论 0原文

从控制台应用程序、asp.net 应用程序、wpf/winform 应用程序调用 WCF 服务时,您必须拥有用于 WCF 服务终结点信息的 app.config 或 web.config 文件。 但从 FitNesse 中,我正在调用一个 .dll(类库)的固定装置,并且该固定装置正在调用我的 WCF 服务。 它无法调用该服务,因为我无法包含它所需的端点信息 - 因为 DLL 不能包含 app.config 文件。 有关如何从 FitNesse 调用 WCF 服务的任何想法。

When calling a WCF service from a console app, asp.net app, wpf/winform app, you have to have a app.config or web.config file for the WCF service endpoint information. But from FitNesse, I'm calling a fixture which is a .dll (class library) and this fixture is calling my WCF service. It can't call the service because I can't include the endpoint information that it needs - because DLLs can't have app.config files. Any ideas on how to call a WCF service from FitNesse.

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

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

发布评论

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

评论(3

深府石板幽径 2024-07-22 10:13:45

您可以使用 WCF 中的配置执行的任何操作也可以通过编程方式完成。 您可以在代码中创建端点然后编译它吗?

Anything you can do with a config in WCF can also be done programmatically. Could you create the endpoints in code and then compile it?

从来不烧饼 2024-07-22 10:13:45

我必须将 app.config 文件放在 FitNesse 的 dotnet 目录中。 我还必须在 FitNesse 页面中添加该配置文件的路径,如下所示。

!路径 C:\fitnesse20090214\fitnesse\dotnet\app.config

I had to place my app.config file in the dotnet directory of FitNesse. I also had to add a path to that config file in my FitNesse page, like this.

!path C:\fitnesse20090214\fitnesse\dotnet\app.config

乞讨 2024-07-22 10:13:45

我正在使用的类似方法是为测试运行程序制作 app.config 的副本。
因此,我将 app.config 复制为 FitServer.exe.config(和 TestRunner.exe.config),作为我的装置项目中的后期构建步骤。
正如上一篇文章所示,配置文件需要与运行程序位于同一目录中。

这适用于 1.6 版本的 Fitnesse .Net runners 以及最新的 20090214 版本。

A similar approach that I have working is to make a copy of the app.config for the testrunner.
So I make a copy of app.config as FitServer.exe.config (and TestRunner.exe.config) as a post build step in my fixture project.
As the previous post indicates, the config file needs to be in the same directory as the runner.

This worked with the 1.6 version of the fitnesse .Net runners as well as the latest 20090214 release.

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