2012-04-13 62 views
5

這是我第一次部署asp.net應用程序。部署asp.net web應用程序的問題

當我構建部署包即用鼠標右鍵單擊該項目並選擇「生成部署包」,我得到以下錯誤:

Error 1 Web deployment task failed.(Object of type 'dbFullSql' and path 'Data Source=.\SQLEXPRESS;AttachDbFilename=C:\JP\ASP\eTracking\test\App_Data\aspnetdb.mdf;Integrated Security=True;User Instance=True' cannot be created.)

Object of type 'dbFullSql' and path 'Data Source=.\SQLEXPRESS;AttachDbFilename=C:\JP\ASP\eTracking\test\App_Data\aspnetdb.mdf;Integrated Security=True;User Instance=True' cannot be created.

Cannot connect to the database 'C:\JP\ASP\eTracking\test\App_Data\aspnetdb.mdf'. 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: 26 - Error Locating Server/Instance Specified) 0 0 eTracking

任何人都可以在這方面幫助..我不能弄明白它似乎無法在網上找到解決方案。

Ok Managed to solve the problem.

In the properties window under the Package/Publish SQL untick the "Pull data and/or schema from an existing database" as well as the "Auto-generated Schema and Data" in the grid.

+0

好管理解決問題。 – vitalix 2012-04-13 02:49:04

回答

0

它看起來像錯誤信息非常簡單 - 您正在應用程序中使用本地連接的數據庫。這不會與包裝商合作。您需要將數據庫訪問權限更改爲服務器數據庫,或者需要將mdf文件包含在應用程序中。

+0

我在SQL Server 2008上使用數據庫,我沒有附加任何其他數據庫,似乎是Visual Studio正在做的事情。我進入了webconfig文件並刪除了:「AttachDBFilename = | DataDirectory | \ aspnetdb.mdf」,但構建部署時仍然出現同樣的錯誤 – vitalix 2012-04-13 01:59:43

+1

好管理解決問題。 在Package/Publish SQL下的屬性窗口中,取消選中「從現有數據庫中提取數據和/或模式」以及網格中的「自動生成的模式和數據」。 – vitalix 2012-04-13 02:53:44

+0

太好了。我很高興你能夠得到它的工作。 – IAmTimCorey 2012-04-13 11:54:52

1

工作:「好管理解決問題在Package/Publish SQL下的屬性窗口中,取消」從現有數據庫中提取數據和/或模式「以及」自動生成的模式和數據「在網格中 「