Firstly, you do not need to set the application credentials. You only need to call SetCredentials once. Remove the assignment to ApplicationCredentials.
If you are receiving Unauthorized exception. Then it could be because of:
If you are receiving Unauthorized exception. Then it could be because of:
- Your credentials are invalid.
-
Your application does not have read/write permissions that are required to be able to post tweets.