WPF Progam中的App.config,在Debug期间工作但未编译

时间:2012-04-24 05:54:10

标签: c# wpf web-services

我有一个WPF程序,它使用由Visual Studio生成的Soap服务。

当我在Visual Studio中以调试模式运行它时工作正常(我将合同放在app.config中)

但是当我在编译之后运行它时,在我的程序所在的目录中使用App.config会出现此错误:

ERROR: Could not find endpoint element with name 'LodgeSoap' and 
contract 'SMSwebService.LodgeSoap' 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 name could be found in the client element.

1 个答案:

答案 0 :(得分:3)

编译应用程序时,它将在bin / debug或bin / release目录中包含程序集。请确保该文件夹中存在[应用程序名称] .exe.config文件,并且此文件中存在soap服务配置信息。