开发者

Problem with WPF and calling a WCF Web Service

开发者 https://www.devze.com 2023-03-24 11:56 出处:网络
I have a major problem that is causing me a headache for the last couple of days! For some reason beyond me my web service isn\'t working and I am getting the classic error message: \"Could not find

I have a major problem that is causing me a headache for the last couple of days!

For some reason beyond me my web service isn't working and I am getting the classic error message: "Could not find default endpoint element". My WCF and WPF are in the same solution folde开发者_StackOverflow社区r and I am referencing my web service through Service Reference, which generates my app.config. In my WPF I call my web service and pass in via the constructor the name of the end point address. Further, I have copied my app.config to the view layer of my WPF, because my WPF uses MVVM design pattern.

Despite all of this it won't work! Any ideas anyone???


Find the folder of the executable of the WPF client application. (bin/debug)

Find the MyClient.exe.config

Open it and check the WCF settings.

If they are missing you probably copied the wrong setting or copied them to the wrong project.

E.g., if you copied them to a project that builds a dll containing the views it will be lost. The settings must be added to the project that builds the executable.

0

精彩评论

暂无评论...
验证码 换一张
取 消