ASP .NET本地部署 - 无法访问数据库

时间:2015-07-02 11:49:25

标签: asp.net sql-server asp.net-mvc-4 web-hosting

我尝试从桌面部署本地网络上的ASP.NET。 我已完成所有IIS步骤,并在登录页面上打开了该网站。 但每次我尝试登录时都会收到此错误。

Server Error in '/MReserve' Application.

The network path was not found

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ComponentModel.Win32Exception: The network path was not found

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[Win32Exception (0x80004005): The network path was not found]

这是我从发布配置文件生成的连接字符串。

  <add name="DefaultConnection" connectionString="Data Source=|DataDirectory|aspnet-MReserve-20150516063047.mdf; Initial Catalog=aspnet-MReserve-20150516063047;Integrated Security=False; MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
<add name="MReserve.Models.MReserveDB" connectionString="Data Source=|DataDirectory|MReserveDB.mdf; Initial Catalog=MReserveDB; Integrated Security=False; MultipleActiveResultSets=True;" providerName="System.Data.SqlClient" />
<add name="MReserve.Models.MReserveDB_DatabasePublish" connectionString="Data Source=|DataDirectory|MReserveDB.mdf; Initial Catalog=MReserveDB; Integrated Security=False; MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />

请你帮我解决这个问题。 我为这两者启用了防火墙的INBOUND规则:TCP / IP连接和万维网。

1 个答案:

答案 0 :(得分:0)

通过启用这些防火墙入站规则解决: 1)SQL端口(1433) 2)Web World Wide 3)IIS Express(本地端口:80)