For the third time, I run into this problem again… For me the decision to create a blogpost for this problem, so I can refresh my memory again in the future :)
Current situation
We’ve created a WinForms application. This application calls a WCF service for some project specific information. When I’m running the application on my domain account, everything works fine. I hit the button for a new window, the service call is made and the project appears nice and smooth in the listview.
After I did a deploy to the testserver, I’m trying the run the same application, and suddenly the window crashes and come up with the message: “The HTTP request is unauthorized with client authentication scheme ‘Anonymous’. The authentication header received from the server was ‘Negotiate,NTLM’”.
The strangest part is that I’m calling the exactly same service which I was using at my local machine.
The problem
After a little bit of digging, I noticed it has something to do with the domain. When I’m logging on at my local machine, I'm using a domain account, in this example: “Domain A”. The testserver, however, is running in a different domain, lets say: “Domain B”. Because I was starting the .exe program with my “Domain A” credentials, the application will call the service with the same credentials. As the WCF service at the testserver cant recognize my credentials because of the difference of the domain, it calls the service with ‘’Anonymous’ credentials.