我使用EPiServer v8.0安装了一个新的空站点。该站点是使用以管理员身份运行的Visual Studio扩展创建的。当我运行该站点时,我收到数据库连接错误:
"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Error occurred during LocalDB instance startup: unable to create the SQL Server process.
)“
我在web.config中的连接字符串是这样的:
<add name="EPiServerDB" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|EPiServerDB_1293efd2.mdf;Initial Catalog=EPiServerDB_1293efd2;Connection Timeout=60;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
我已经并排安装了Alloy网站,这样就行了。 Alloy的连接字符串与我的空站点相同,但数据库名称除外。
我在SQLLocalDB的事件查看器应用程序日志中有很多这些错误:
Windows API call CreateProcessAsUserW returned error code: 740. Windows system error message is: The requested operation requires elevation.
Reported at line: 3705.
答案 0 :(得分:0)
确保您可以使用Windows身份验证通过Management Studio连接到数据库(因为您的连接字符串中包含Integrated Security = True)。
如果没有,你是否安装了LocalDB?
接下来,确保Web应用程序上下文的用户能够访问数据库;如果您正在运行IIS Express,那么这将是您用来启动Visual Studio的帐户。
如果您正在运行成熟的IIS,它将成为应用程序池的帐户。
答案 1 :(得分:0)
问题结果与LocalDB有关。我的LocalDB已停止运行,因此当我安装空的EPiServer站点时,数据库未正确设置。很奇怪安装程序没有返回任何错误。
这是一个反复出现的问题,我还没有到底。 LocalDB一直在停止,但我不知道为什么。