wcf c# error while accessing directory

Asked

Viewed 84 times

0

I’m writing a service WCF using c#. In one of my methods I try to access a directory on the network (any command like directory.Exists() or directory.GetFiles()) and I get the following mistake:

System.ServiceModel.Faultexception`1[[System.ServiceModel.Exceptiondetail, System.Servicemodel, Version=4.0.0.0, Culture=neutral, Publickeytoken=b77a5c561934e089]]: Username or password incorrect.

If I try to access the same directory from an application Web API works normally. Someone has had this problem and could help me?

  • 2

    This running local or posted on the server? may be due to the difference in credentials between one application and another.

  • I tried to run both locally and on a server and get the same error.

1 answer

1

The service WCF was showing a generic error message, switched to show a more specific message and found that it was user problem as they said earlier, to resolve this I created a user on my machine and a user on the target machine with the same credentials. After I changed the Gap of IIS to use the user I created. Thus it was possible to access the directories.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.