11

I have a server which is part of a domain. When I publish a web application from Visual Studio with a domain user everything is ok. But when I try to publish with a local machine user (not part of a domain) I get ERROR_USER_NOT_ADMIN. Both users are in Administrators group. I tried specifying user as username, .\username and machinename\username but it's not working. Is there anything else I should do to be able to publish with a local machine user?

redman
  • 1,895
  • 4
  • 30
  • 58

3 Answers3

4

I received this error when I published with an incorrect password.

Not the best answer in the world but I post this to point out that an incorrect password does indeed return this exact error though you would never know it when you read the error message.

Tony L.
  • 13,638
  • 8
  • 61
  • 63
  • 1
    I can confirm that the problem was this in my case. But i think Windows is reseting the password because every X time my password doesn´t work and I have to change it to the same I always use for this user. – acromm May 24 '16 at 16:08
  • 1
    Over and over I tried to fix this error, and it ended up being I needed double quotes around my password. Go figure. – Phil Jun 05 '19 at 20:25
4

This error can also be received when deploying ASP.NET Core application with Visual Studio 2015. In order to fix the problem in this case, add the following lines in the .pubxml file:

<ADUsesOwinOrOpenIdConnect>False</ADUsesOwinOrOpenIdConnect>
<AuthType>NTLM</AuthType>
Nikolay Kostov
  • 14,580
  • 20
  • 75
  • 115
  • 1
    Hi Nikolay, thanks you saved me a lot of time! Please consider to post this as separate question with your own answer as it can be very helpful for community. Thank you again!. – marek_lani Nov 12 '16 at 15:42
1

You can't do that, server you aim to publish in to needs an authorized domain account to allow access to your Visual Studio publishing service. Local accounts are specific to your local machine regardless whether they are administrator logins. They are just local admin login not domain admin logins.

Get your administrator to set up a domain user (don't use domain admin accounts this is a security risk) for publishing purposes or use your current domain user account

JOAT
  • 168
  • 6