How to create a local user profile for an anonymous user of an ASP.Net MVC application in IIS 7?

I experimented with ASP.Net MVC and ran into a problem that is probably not specifically related to MVC. But I can’t get authentication in the default MVC application (created by the wizard when creating a new MVC project) to work correctly in IIS 7 on Windows 7.

If I start the Visual Studio environment, it works, but if I switch the parameters that run under IIS, I get the following exception when trying to send a login or registration:

SQL Server user instance could not be created due to a failure in getting the local user application data path. Please make sure that the user has a local user profile on the computer. The connection will be closed.

I believe this is because the website runs under my own account in Visual Studio, but under the IUSR account in IIS. So far, Google’s search queries in the exception message have been useless.

So, can I create a local user profile for an IUSR account? If so, how? Is there anything else I have to do to get the SQLExpress engine to work under an anonymous account in IIS 7?

I also tried to configure the IIS website to use my account, but since it is my home computer, my account does not have a password, and it seems that IIS will not allow the website to be configured to use the account without a password. Or, since this is my first experience with IIS 7, and the configuration seems very different from IIS 5/6, I just skip the correct setting, which will allow me to configure the account for anonymous access.

EDIT: additional information. If I empty the App_Data folder and try again from IIS, SQLExpress tries to create my database and fails, but the exception message contains additional information with the following suggestions.

Automatically creating a SQLExpress database file Error:

Sql Server Express App_Data. , . :

  • App_Data , - . , - App_Data .
  • App_Data , - App_Data. - , Sql - App_Data. App_Data - , Sql Server Express . , . - .
  • Sql Server Express .
  • - . . readme , .

, . , -, , , . , readme, , .

+3
3

. , , . , Web.Config

<trust level="TrustLevel" />

Web.Config , . , IIS machine.config, .

, , , - aspnet_regsql.exe , Web.Config, .

+4

"" LocalApplicationData " ". SSIS SQL Job, , SQL SSIS SQL Server , swql, !

.

+1

Solution: Try to FIX any updates before you start experiencing the problem. I spent countless hours — wasted hours that I will never return in my life — I read and followed all possible solutions without success. I uninstalled all SQL Server updates and now everything is working fine.

0
source

Source: https://habr.com/ru/post/1702896/


All Articles