【发布时间】:2012-07-19 03:42:27
【问题描述】:
我创建了一个应连接到我托管的 WCF 端点项目的类库。 客户端项目定义了应与服务交互的命令行开关。
但是,我不断收到以下错误:
Could not find default endpoint element that references contract Service1.MyService in the
ServiceModel client configuration section. This might be because no configuration file was found
for your application, or because no endpoint element matching this contract could be found in the
client element.
你知道问题可能是什么吗?
编辑 我拥有的是一个定义 cmdlet 的类库。我使用 .psd1 文件导入使用生成的 dll 文件的 Import-Module。
EDIT2 再一次,我没有引用我的库的项目。调用定义的命令行开关的是 powershell,这些 cmdlet 应该连接到 WCF 端点
谢谢
【问题讨论】:
-
旧帖子,但我也发现了对这个错误的观察。如果您有 2 个程序集,其中一个程序集调用具有服务引用的另一个程序集中的方法,而另一个程序集是启动程序集,则您的服务配置也需要在启动程序集中。
标签: c# .net wcf powershell cmdlets