Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

running dotnet pack in a GitHub action results in MSB4236

Đang mở
#397 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
csharp, github-actions, powershell
Lĩnh vực
build-system, ci-cd

Hướng nghiên cứu

Bắt đầu với src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj và workflow GitHub Actions chạy dotnet pack. So sánh các môi trường cục bộ và GitHub Actions, sau đó lần theo ngăn xếp phân giải nguồn NuGet được hiển thị trong lỗi. Hoàn tất khi dự án được đóng gói thành công trong GitHub Action cũng như cục bộ mà không gặp lỗi đã báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I have a .csproj project used to hold powershell scripts:

<Project Sdk="Microsoft.Build.NoTargets">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <VersionPrefix>1.0.0</VersionPrefix>
    <Authors>mmisztal1980</Authors>
    <Company>cloud-tek</Company>
    <PackageTags>k8s kubernetes powershell automation</PackageTags>
    <RepositoryUrl>https://github.com/cloud-tek/automation</RepositoryUrl>
    <Description>
      This package contains reusable kubernetes powershell automation
    </Description>
  </PropertyGroup>

  <ItemGroup>
    <Content Include="*.ps*1">
      <Pack>true</Pack>
      <PackagePath>.</PackagePath>
    </Content>
  </ItemGroup>
</Project>

When running dotnet pack locally, the project builds fine.
When running dotnet pack in a github action, I'm getting a:

Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error : System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error : System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :  ---> System.NullReferenceException: Object reference not set to an instance of an object.
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :  ---> System.NullReferenceException: Object reference not set to an instance of an object.
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3(SourceRepository source, DateTime utcNow, ILogger log, CancellationToken token)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3(SourceRepository source, DateTime utcNow, ILogger log, CancellationToken token)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Protocol.ServiceIndexResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Protocol.ServiceIndexResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T]()
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T]()
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Protocol.HttpFileSystemBasedFindPackageByIdResourceProvider.TryCreate(SourceRepository sourceRepository, CancellationToken token)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Protocol.HttpFileSystemBasedFindPackageByIdResourceProvider.TryCreate(SourceRepository sourceRepository, CancellationToken token)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T]()
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T]()
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.SourceRepositoryDependencyProvider.EnsureResource()
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.SourceRepositoryDependencyProvider.EnsureResource()
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.SourceRepositoryDependencyProvider.FindLibraryCoreAsync(LibraryRange libraryRange, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.SourceRepositoryDependencyProvider.FindLibraryCoreAsync(LibraryRange libraryRange, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.SourceRepositoryDependencyProvider.<>c__DisplayClass21_0.<<FindLibraryAsync>b__0>d.MoveNext()
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.SourceRepositoryDependencyProvider.<>c__DisplayClass21_0.<<FindLibraryAsync>b__0>d.MoveNext()
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error : --- End of stack trace from previous location ---
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error : --- End of stack trace from previous location ---
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.SourceRepositoryDependencyProvider.FindLibraryAsync(LibraryRange libraryRange, NuGetFramework targetFramework, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.SourceRepositoryDependencyProvider.FindLibraryAsync(LibraryRange libraryRange, NuGetFramework targetFramework, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.ResolverUtility.<FindLibraryFromSourcesAsync>g__FindLibraryFromProviderAsync|9_0(IRemoteDependencyProvider provider, LibraryRange libraryRange, NuGetFramework framework, SourceCacheContext cacheContext, ILogger logger, CancellationToken token)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.ResolverUtility.<FindLibraryFromSourcesAsync>g__FindLibraryFromProviderAsync|9_0(IRemoteDependencyProvider provider, LibraryRange libraryRange, NuGetFramework framework, SourceCacheContext cacheContext, ILogger logger, CancellationToken token)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.ResolverUtility.FindLibraryFromSourcesAsync(LibraryRange libraryRange, IEnumerable`1 providers, NuGetFramework framework, SourceCacheContext cacheContext, ILogger logger, CancellationToken token)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.ResolverUtility.FindLibraryFromSourcesAsync(LibraryRange libraryRange, IEnumerable`1 providers, NuGetFramework framework, SourceCacheContext cacheContext, ILogger logger, CancellationToken token)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.ResolverUtility.FindLibraryByVersionAsync(LibraryRange libraryRange, NuGetFramework framework, IEnumerable`1 providers, SourceCacheContext cacheContext, ILogger logger, CancellationToken token)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.ResolverUtility.FindLibraryByVersionAsync(LibraryRange libraryRange, NuGetFramework framework, IEnumerable`1 providers, SourceCacheContext cacheContext, ILogger logger, CancellationToken token)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.ResolverUtility.FindPackageLibraryMatchAsync(LibraryRange libraryRange, NuGetFramework framework, IEnumerable`1 remoteProviders, IEnumerable`1 localProviders, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.ResolverUtility.FindPackageLibraryMatchAsync(LibraryRange libraryRange, NuGetFramework framework, IEnumerable`1 remoteProviders, IEnumerable`1 localProviders, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.ResolverUtility.FindLibraryMatchAsync(LibraryRange libraryRange, NuGetFramework framework, String runtimeIdentifier, IEnumerable`1 remoteProviders, IEnumerable`1 localProviders, IEnumerable`1 projectProviders, IDictionary`2 lockFileLibraries, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.ResolverUtility.FindLibraryMatchAsync(LibraryRange libraryRange, NuGetFramework framework, String runtimeIdentifier, IEnumerable`1 remoteProviders, IEnumerable`1 localProviders, IEnumerable`1 projectProviders, IDictionary`2 lockFileLibraries, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.ResolverUtility.FindLibraryEntryAsync(LibraryRange libraryRange, NuGetFramework framework, String runtimeIdentifier, RemoteWalkContext context, CancellationToken cancellationToken)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.ResolverUtility.FindLibraryEntryAsync(LibraryRange libraryRange, NuGetFramework framework, String runtimeIdentifier, RemoteWalkContext context, CancellationToken cancellationToken)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.RemoteDependencyWalker.CreateGraphNode(LibraryRange libraryRange, NuGetFramework framework, String runtimeName, RuntimeGraph runtimeGraph, Func`2 predicate, GraphEdge`1 outerEdge, TransitiveCentralPackageVersions transitiveCentralPackageVersions)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.RemoteDependencyWalker.CreateGraphNode(LibraryRange libraryRange, NuGetFramework framework, String runtimeName, RuntimeGraph runtimeGraph, Func`2 predicate, GraphEdge`1 outerEdge, TransitiveCentralPackageVersions transitiveCentralPackageVersions)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.RemoteDependencyWalker.CreateGraphNode(LibraryRange libraryRange, NuGetFramework framework, String runtimeName, RuntimeGraph runtimeGraph, Func`2 predicate, GraphEdge`1 outerEdge, TransitiveCentralPackageVersions transitiveCentralPackageVersions)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.RemoteDependencyWalker.CreateGraphNode(LibraryRange libraryRange, NuGetFramework framework, String runtimeName, RuntimeGraph runtimeGraph, Func`2 predicate, GraphEdge`1 outerEdge, TransitiveCentralPackageVersions transitiveCentralPackageVersions)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.RemoteDependencyWalker.WalkAsync(LibraryRange library, NuGetFramework framework, String runtimeIdentifier, RuntimeGraph runtimeGraph, Boolean recursive)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.DependencyResolver.RemoteDependencyWalker.WalkAsync(LibraryRange library, NuGetFramework framework, String runtimeIdentifier, RuntimeGraph runtimeGraph, Boolean recursive)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.ProjectRestoreCommand.WalkDependenciesAsync(LibraryRange projectRange, NuGetFramework framework, String runtimeIdentifier, RuntimeGraph runtimeGraph, RemoteDependencyWalker walker, RemoteWalkContext context, CancellationToken token)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.ProjectRestoreCommand.WalkDependenciesAsync(LibraryRange projectRange, NuGetFramework framework, String runtimeIdentifier, RuntimeGraph runtimeGraph, RemoteDependencyWalker walker, RemoteWalkContext context, CancellationToken token)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.ProjectRestoreCommand.TryRestoreAsync(LibraryRange projectRange, IEnumerable`1 frameworkRuntimePairs, NuGetv3LocalRepository userPackageFolder, IReadOnlyList`1 fallbackPackageFolders, RemoteDependencyWalker remoteWalker, RemoteWalkContext context, Boolean forceRuntimeGraphCreation, CancellationToken token, TelemetryActivity telemetryActivity, String telemetryPrefix)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.ProjectRestoreCommand.TryRestoreAsync(LibraryRange projectRange, IEnumerable`1 frameworkRuntimePairs, NuGetv3LocalRepository userPackageFolder, IReadOnlyList`1 fallbackPackageFolders, RemoteDependencyWalker remoteWalker, RemoteWalkContext context, Boolean forceRuntimeGraphCreation, CancellationToken token, TelemetryActivity telemetryActivity, String telemetryPrefix)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.RestoreCommand.ExecuteRestoreAsync(NuGetv3LocalRepository userPackageFolder, IReadOnlyList`1 fallbackPackageFolders, RemoteWalkContext context, CancellationToken token, TelemetryActivity telemetryActivity)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.RestoreCommand.ExecuteRestoreAsync(NuGetv3LocalRepository userPackageFolder, IReadOnlyList`1 fallbackPackageFolders, RemoteWalkContext context, CancellationToken token, TelemetryActivity telemetryActivity)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.RestoreCommand.ExecuteAsync(CancellationToken token)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.RestoreCommand.ExecuteAsync(CancellationToken token)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.RestoreRunner.ExecuteAsync(RestoreSummaryRequest summaryRequest, CancellationToken token)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.RestoreRunner.ExecuteAsync(RestoreSummaryRequest summaryRequest, CancellationToken token)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.RestoreRunner.CompleteTaskAsync(List`1 restoreTasks)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.RestoreRunner.CompleteTaskAsync(List`1 restoreTasks)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.RestoreRunner.RunWithoutCommit(IEnumerable`1 restoreRequests, RestoreArgs restoreContext)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at NuGet.Commands.RestoreRunner.RunWithoutCommit(IEnumerable`1 restoreRequests, RestoreArgs restoreContext)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    --- End of inner exception stack trace ---
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    --- End of inner exception stack trace ---
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at System.Threading.Tasks.Task`1.get_Result()
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at System.Threading.Tasks.Task`1.get_Result()
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at Microsoft.Build.NuGetSdkResolver.NuGetSdkResolver.NuGetAbstraction.GetSdkResult(SdkReference sdk, Object nuGetVersion, SdkResolverContext context, SdkResultFactory factory)
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error :    at Microsoft.Build.NuGetSdkResolver.NuGetSdkResolver.NuGetAbstraction.GetSdkResult(SdkReference sdk, Object nuGetVersion, SdkResolverContext context, SdkResultFactory factory)
  Error: /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error MSB4236: The SDK 'Microsoft.Build.NoTargets' specified could not be found.
  08:54:22 [ERR] /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj : error MSB4236: The SDK 'Microsoft.Build.NoTargets' specified could not be found.
  Error: Target "Pack" failed
  08:54:22 [ERR] Target Pack failed
  Nuke.Common.Tooling.ProcessException: Process 'dotnet' exited with code 1.
     > /home/runner/.dotnet/dotnet pack /home/runner/work/automation/automation/src/CloudTek.Automation.Shell/CloudTek.Automation.Shell.csproj --configuration Release --output /home/runner/work/automation/automation/artifacts/packages/CloudTek.Automation.Shell /property:Version=0.1.52 /property:FileVersion=0.1.52.0 /property:AssemblyVersion=0.1.52.0
     @ /home/runner/work/automation/automation
  
     at Nuke.Common.Tooling.ProcessExtensions.AssertZeroExitCode(IProcess process)
     at Nuke.Common.Tools.DotNet.DotNetTasks.DotNetPack(DotNetPackSettings toolSettings)
     at Nuke.Common.Tools.DotNet.DotNetTasks.DotNetPack(Configure`1 configurator)
     at CloudTek.Build.SmartBuild.<get_Pack>b__30_3(Artifact artifact)
     at Nuke.Common.Utilities.Collections.EnumerableExtensions.ForEach[T](IEnumerable`1 enumerable, Action`1 action)
     at CloudTek.Build.SmartBuild.<get_Pack>b__30_1()
     at Nuke.Common.Execution.BuildExecutor.<>c.<Execute>b__4_2(Action x)
     at Nuke.Common.Utilities.Collections.EnumerableExtensions.ForEach[T](IEnumerable`1 enumerable, Action`1 action)
     at Nuke.Common.Execution.BuildExecutor.Execute(NukeBuild build, ExecutableTarget target, IReadOnlyCollection`1 previouslyExecutedTargets, Boolean failureMode)

The root of the project contains a global.json file:

{
  "tools": { "dotnet": "6.0.401" },
  "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.5.6" }
}

Can anyone explain the phenomenon?

Ngôn ngữ chính
C#
Star
513
Fork
94
Merge trung bình
49 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/MSBuildSdks

Tất cả issue của microsoft/MSBuildSdks

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.