I know this question has been asked many times before but I don't seem to be able to find a solution to my problem.
I had to rename some prototype projects I was working on, and these worked perfectly well before being renamed but since renaming them and creating a new application app pool, I can no longer access my database and keep getting the following error:
Login failed for user 'Domain\\MachineName$'
My Web API and database are on the same machine and I still want to use the AppPool rather than specifying a username and password or use the SystemLocal as it worked before and would like to figure out what's changed.
I can see that the identity of my web API is indeed my domain\me but somehow when it's trying to open the database from the injected repository, I'm getting the above error.
I've checked the following:
My connection string hasn't changed:
data source=MyMachine\SQLInstance;Initial Catalog=MyDatabase;integrated security=SSPI;
I've compared the old AppPool and the new one and they are identical.
I've added my new AppPool to SQL server and granted it access to the database with datareader/datawriter access.
I've added the new AppPool to security for the (renamed) directory folder.
All authentications are disabled in IIS except for Windows Authentication. This part must work since my web api's identity is my domain/me user. I just don't get why it is trying to use the machine name when opening the database.
I've read the following to check if I could find anything else but to no avail:
Has anyone got any other suggestions?
Thanks.
UPDATE-1:
- Odd, I thought I'd try to use my username and password for the new AppPool and yet, I'm still getting the same error.