我有一個通過連接到SQL 2016實例並將數據庫導入Visual Studio創建的數據庫項目。部署CLR時從TFS部署數據庫失敗
我通過創建發佈文件並將其檢入到源代碼控制中來創建了一個部署。在我必須更改的設置中,不要部署任何用戶帳戶或權限更改,因爲它想從我的系統中刪除多個帳戶。
當TFS執行的MSBuild做部署,這裏所傳遞的命令行參數:/p:VisualStudioVersion=14.0 /噸:建設;發佈/p:SqlPublishProfilePath=MyDBProj.publish.xml
問題在於,如果我不排除CLR用戶定義類型,也排除組件,部署失敗,出現以下(其中包括許多其他類似的)錯誤:
C:\Builds\1\MyDBProj\MyDBProj - Prod\bin\MyDBProj.publish.sql (0, 0)
[System.Web] has an unresolved dependency to [System.Design]. A deployment script with correct ordering cannot be created.
C:\Builds\1\MyDBProj\MyDBProj - Prod\bin\MyDBProj.publish.sql (0, 0)
[System.Runtime.Remoting] has an unresolved dependency to [System.Web]. A deployment script with correct ordering cannot be created.
C:\Builds\1\MyDBProj\MyDBProj - Prod\bin\MyDBProj.publish.sql (0, 0)
[System.Design] has an unresolved dependency to [System.Web]. A deployment script with correct ordering cannot be created.
C:\Builds\1\MyDBProj\MyDBProj - Prod\bin\MyDBProj.publish.sql (0, 0)
An error occurred during deployment plan generation. Deployment cannot continue.
(-1, 0)
Exception Message: MSBuild error 1 has ended this build. You can find more specific information about the cause of this error in above messages. (type BuildProcessTerminateException)
Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
我試圖引用作爲主數據庫引用。我不確定還有什麼要做。構建在TFS上時,我需要與數據庫一起部署的CLR組件。
構建是否在沒有任何問題的情況下在本地執行(而不是通過TFS)? –
是的。如果我登錄到同一臺機器(Build Server/TFS服務器),Load VS和項目,構建和部署,所有工作正常。只有在通過TFS運行時纔會失敗。 – SpaceCowboy74