目標依賴關係圖中存在循環依賴項我試圖將Docker支持添加到現有的ASP.Net(Core)Web應用程序。在涉及目標「DockerBuildServiceReferences」
到目前爲止,我所做的只是右鍵單擊我的解決方案,然後單擊Add > Docker Support
。當我再嘗試開始使用泊塢窗中,我得到以下錯誤調試:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.Compose.targets(170,5): error MSB4006: There is a circular dependency in the target dependency graph involving target "DockerBuildServiceReferences".
我檢查了Microsoft.VisualStudio.Docker.Compose.targets
文件,我看不到涉及DockerBuildServiceReferences
任何循環依賴,其實通過這僅僅是整個文件搜索
<!--
***********************************************************************************************
Docker Compose Project Targets
***********************************************************************************************
-->
<UsingTask TaskName="CleanWorkspace" AssemblyFile="$(DockerBuildTasksAssembly)" />
<UsingTask TaskName="EnsureMsVsMonExists" AssemblyFile="$(DockerBuildTasksAssembly)" />
<UsingTask TaskName="EnsureVsDbgExists" AssemblyFile="$(DockerBuildTasksAssembly)" />
<UsingTask TaskName="GetServiceReferences" AssemblyFile="$(DockerBuildTasksAssembly)" />
<UsingTask TaskName="PrepareForBuild" AssemblyFile="$(DockerBuildTasksAssembly)" />
<UsingTask TaskName="PrepareForLaunch" AssemblyFile="$(DockerBuildTasksAssembly)" />
<PropertyGroup>
<BuildDependsOn>
DockerSetDevelopmentMode;
DockerPrepareForBuild;
DockerGetServiceReferences;
DockerBuildServiceReferences;
$(BuildDependsOn);
DockerComposeBuild;
DockerPrepareForLaunch;
</BuildDependsOn>
<CleanDependsOn>
DockerSetDevelopmentMode;
DockerCleanWorkspace;
$(CleanDependsOn);
DockerGetServiceReferences;
DockerCleanServiceReferences;
</CleanDependsOn>
</PropertyGroup>
<PropertyGroup>
<DockerComposeProjectPath>$(MSBuildProjectFullPath)</DockerComposeProjectPath>
</PropertyGroup>
而且:
<!--
***********************************************************************************************
TARGET : DockerBuildServiceReferences
***********************************************************************************************
-->
<Target Name="DockerBuildServiceReferences">
<PropertyGroup>
<DockerServiceReferenceTarget Condition=" '$(DockerDevelopmentMode)' == 'Regular' ">DockerPackageService</DockerServiceReferenceTarget>
<DockerServiceReferenceTarget Condition=" '$(DockerServiceReferenceTarget)' == '' ">Build</DockerServiceReferenceTarget>
</PropertyGroup>
<MSBuild Projects="@(DockerServiceReference)"
Targets="$(DockerServiceReferenceTarget)"
Properties="Configuration=$(Configuration);Platform=$(Platform);BuildingInsideVisualStudio=false"
Condition=" '@(DockerServiceReference)' != '' " />
</Target>
我也試着從頭創建一個新的ASP.NET應用程序的核心在兩個地方提到並增加了docker的支持,它完美的工作。這導致我相信這個錯誤覆蓋了別的東西。
我使用Visual Studio 2017年和docker version
輸出如下(有沒有什麼幫助的話):
Client:
Version: 17.05.0-ce-rc1
API version: 1.27 (downgraded from 1.29)
Go version: go1.7.5
Git commit: 2878a85
Built: Wed Apr 12 19:43:25 2017
OS/Arch: windows/amd64
Server:
Version: 17.03.1-ce
API version: 1.27 (minimum version 1.12)
Go version: go1.7.5
Git commit: c6d412e
Built: Fri Mar 24 00:00:50 2017
OS/Arch: linux/amd64
Experimental: true
任何想法,將不勝感激!
我早點明白了,但忘了發佈答案。既然你張貼我會給你的代表:) – KidCode
謝謝你:) – VMAtm