1

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:

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.
Thierry
  • 6,142
  • 13
  • 66
  • 117

1 Answers1

0

I figured out the problem. This is really odd and appears to be an issue with IIS.

As mentioned in my question, my web API was set to the new AppPool and I could clearly see it the AppPool set correcly via "Advanced Settings" from the "Action" menu in IIS, but when I right clicked on the Web Api virtual folder and selected "Manage Application|Advanced settings", the AppPool name was set to the DefaultAppPool.

The second I changed it, everything worked as it did before using my new AppPool.

Note:

  • I also removed the new AppPool from the Security applied on the folder as it didn't seem to have any effect once I changed the above!

  • It must have been a once off problem as I've just changed my website and changing the AppPool via the "Actions" also displayed correctly when I checked "Manage Application|Advanced settings".

Thierry
  • 6,142
  • 13
  • 66
  • 117