I have a .Net Core 2.0 application that I host in IIS 7.
With IIS Express, the application works fine, and I can successfully connect to the database. With IIS, I get this error:
Unable to open the database "Books"requested at login. Login failed. Login failed for user 'DOMAINNAME\PCNAME$'.
"Books"
'DOMAINNAME\PCNAME$'
My connectionString's file is appsettings.production.jsonas follows:
appsettings.production.json
"ConnectionStrings": { "BooksDatabase": "Server=PCNAME\\SQLEXPRESS;Database=Books;user id=iisAccess;password=iisPassword;Trusted_Connection=True;ConnectRetryCount=0;MultipleActiveResultSets=true" };
What am I doing wrong and why does it say that "login failed for" DOMAINNAME \ PCNAME $ "" when I put the credentials user id=iisAccess;password=iisPassword;in my JSON file?
user id=iisAccess;password=iisPassword;
You are requesting Windows authentication:
Trusted_Connection=True
.
:
IISExpress . , Windows. IISExpress, , Windows - , SQL Server.
IIS, , . , . , IIS , "" . , SQL Server, SQL "" , DOMAIN\MACHINE $.
, ASPNETCORE_ENVIRONMENT (.. , Production).
ASPNETCORE_ENVIRONMENT
Production
( ) ASPNETCORE_ENVIRONMENT Production. IIS , Load User Profile True.
Load User Profile
True
Source: https://habr.com/ru/post/1693646/More articles:Создайте ASN.1 из двух больших целых чисел - javaAngular 2 - Why can't you print the input value - angularHow to change boolean value in multi-threaded environment? - javaUnderstanding callbacks in node - javascriptECDSA Signs Using OpenSSL Without Hash Encoding ASN1 - cryptographyIs there any practical difference between these two definitions of summing Peano Natural's natural numbers? - typesCompute a measure of "almost multiplicity" from a list of noisy values - pythonComplicated C ++ inheritance and smart kill of smart pointer cause heap corruption in VS 2017 - c ++How to use the composer psr-4 - phpHow to intercept function return values in Visualizer Delphi Debugger? - delphiAll Articles