![](/img/trans.png)
[英][Win32Exception (0x80004005): The system cannot find the file specified]
[英]appharbor [Win32Exception (0x80004005): The system cannot find the file specified] with model first EF
我有一個小項目,在其中我與bitbucket和appharbor進行了持續集成。發布該項目時,登錄正常,依此類推,但其他數據庫連接卻出現以下錯誤:
系統找不到指定的文件說明:執行當前Web請求期間發生未處理的異常。 請查看堆棧跟蹤,以獲取有關錯誤及其在代碼中起源的更多信息。
異常詳細信息:System.ComponentModel.Win32Exception:系統找不到指定的文件
這是我的本地連接字符串
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-ZeinyCenter-20130614160141;Integrated Security=SSPI;" providerName="System.Data.SqlClient" />
<add name="Model1Container" connectionString="metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string="Data Source=(LocalDb)\v11.0;initial catalog=aspnet-ZeinyCenter-20130614160141;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
這是appharbor連接字符串
Server=576666e4-329e-4511-95b9-a1dd00ff4766.sqlserver.sequelizer.com;Database=db576666e4329e451195b9a1dd00ff4766;User ID=yusmzpttdopksbua;Password=H3Ex6jp3wihobPu3W2KZHBpW7tDk8SWtxYWTxabXGXhVBGTAnRJZz6AgLRzKNe4L;
有人可以幫幫我嗎
我輸入了appharbor在Web.config
上給我的connectionString
,解決了我的問題。
腳步:
1)進入appharbor並選擇您的應用程序。
2)單擊加載項,然后選擇SQL Server(安裝免費的)。
3)然后單擊轉到SQL Server。
4)滾動到底部,您將看到連接字符串。
5)復制所有文件(單擊它並按ctrl + A),該文件顯示Server=bla bla bla
。
6)現在轉到Visual Studio-> Web.config並將其粘貼到:
add name="DefaultConnection"
connectionString="Your appharbor connectionString"
providerName="System.Data.SqlClient" />
例如,我的是這樣的:
add name="DefaultConnection"
connectionString="Data Source=(LocalDb)\v11.0;
Initial Catalog=aspnet-DeliveriandoWebApp-20131019135542;
Integrated Security=SSPI;
AttachDBFilename=|DataDirectory|\aspnet-DeliveriandoWebApp-20131019135542.mdf"
providerName="System.Data.SqlClient" />
現在是這樣的:
add name="DefaultConnection"
connectionString="Server=8a6b279b-0441-49c7-a97e-a2860049ea89.sqlserver.sequelizer.com;
Database=db8edfdf6c279c044149e7a17ea2860049ea89;
User ID=lolyctkwkaebnkj3;
Password=nYhP4hZKDNMLftEaSyeeeS8eVpbs3H3seUZQUQ8PZzMRXA5hPVfDirfPwZzHfvaFDsz;"
providerName="System.Data.SqlClient" />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.