在dotnet构建或发布期间无法找到包含目录的存储库

时间:2018-12-09 19:55:51

标签: c# asp.net-core .net-core dotnet-cli

我在我的ASP.NET Core 2.2应用程序中添加了对Docker的支持,并在本地测试Docker的命令时发现for index, item in enumerate(a): ## a is your list [-1.5,1,1,0,1,1.5] if item == 1.5: a[index] = 1 elif item == -1.5: a[index] = -1 elif a[index] == 0: a[index] = 0 elif a[index] == 1 and a[index-1] ==0: a[index] = 0 else: a[index] =1 错误。

./ IdentityServer.sln

dotnet publish -f netcoreapp2.2 -c Release -o out

./ IdentityServer / IdentityServer.csproj:https://gist.github.com/paulcsiki/4d3b827af418044dacea0149a2361b81

在解决方案所在的文件夹中输出Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServer", "IdentityServer\IdentityServer.csproj", "{A435DE31-3D1C-4228-BBD9-0157E849D07D}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dependencies", "Dependencies", "{0A7E3F1D-5162-463F-BAF8-714C7FD37B8C}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServer4", "dependencies\identityserver4\src\IdentityServer4.csproj", "{3A32B19C-B6FC-4A2D-9421-5A16849B7C2A}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServer4.AspNetIdentity", "dependencies\identityserver4.aspnetidentity\src\IdentityServer4.AspNetIdentity.csproj", "{0E36AE9A-B9B6-4E1C-B446-82A3265432F8}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServer.Email", "IdentityServer.Email\IdentityServer.Email.csproj", "{BD699934-C404-4CF4-B77C-511E584D1754}" EndProject

dotnet restore

在解决方案所在的文件夹中输出 Restore completed in 52.96 ms for /Users/paul/docker/dependencies/identityserver4.aspnetidentity/src/IdentityServer4.AspNetIdentity.csproj. Restore completed in 52.96 ms for /Users/paul/docker/dependencies/identityserver4/src/IdentityServer4.csproj. Restore completed in 54.56 ms for /Users/paul/docker/IdentityServer/IdentityServer.csproj. Restore completed in 52.97 ms for /Users/paul/docker/IdentityServer.Email/IdentityServer.Email.csproj.

dotnet publish -f netcoreapp2.2 -c Release -o out

我尝试从WebApp文件夹(/ Users / paul / docker / IdentityServer)中运行restore和publish命令,它会产生相同的输出。

Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Restore completed in 44.29 ms for /Users/paul/docker/dependencies/identityserver4/src/IdentityServer4.csproj. Restore completed in 44.3 ms for /Users/paul/docker/IdentityServer.Email/IdentityServer.Email.csproj. Restore completed in 45.91 ms for /Users/paul/docker/IdentityServer/IdentityServer.csproj. Restore completed in 44.3 ms for /Users/paul/docker/dependencies/identityserver4.aspnetidentity/src/IdentityServer4.AspNetIdentity.csproj. /Users/paul/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error : Unable to locate repository containing directory '/Users/paul/docker/dependencies/identityserver4/src'. [/Users/paul/docker/dependencies/identityserver4/src/IdentityServer4.csproj] IdentityServer.Email -> /Users/paul/docker/IdentityServer.Email/bin/Release/netcoreapp2.2/IdentityServer.Email.dll IdentityServer.Email -> /Users/paul/docker/IdentityServer.Email/bin/Release/netcoreapp2.2/IdentityServer.Email.Views.dll IdentityServer.Email -> /Users/paul/docker/IdentityServer.Email/out/ 的输出:

file /Users/paul/docker/dependencies/identityserver4/src/IdentityServer4.csproj

3 个答案:

答案 0 :(得分:4)

问题是我引用了一个名为IdentityServer4的项目,该项目引用了正在寻找.git文件夹的Sourcelink NuGet包。删除软件包引用已解决了该问题。

答案 1 :(得分:2)

我可以确认@Paul解决方案。我编辑了.csproj文件,并删除了对Microsoft.SourceLink.GitHub的软件包引用:

<Project Sdk="Microsoft.NET.Sdk">
  <ItemGroup>
    <!-- Remove following line: -->
    <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-62925-02" PrivateAssets="All" />
  </ItemGroup>
</Project>

答案 2 :(得分:-1)

工具->选项->源代码控制->当前源代码控制插件:无