Scenario: Multiple accounts on the server are used together, and the administrator's domain account has been added. When VS develops webpart, the reported site Url is invalid, the local sharepoint server cannot, and the created webpart does not have a g.cs file
Reason: Although the domain account has been added as an administrator, it has no access rights to the database server. Add the domain account to the database account and configure the db_owner permission.
problem solved. . .
Then there was a problem. IIS application pool recycling error. . . This is caused by the user's lack of access rights to the website. Grant the site collection administrator rights, and you can deploy it normally.
Considering another problem, if you configure the db_owner permission, then every time you create a new application and configure it as a site URL, you need to go to the database server to configure the permissions, which feels so troublesome.
Later, configure the server role for the user: sysadmin, one-click to get it (I don't know if there are other problems, haha)
Attachment: Role and permission management in sql server: https://blog.csdn.net/bigheadsheep/article/details/8722175