Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#65082 closed defect (fixed)

dotnet-sdk-6: unable to install global tool

Reported by: mohd-akram (Mohamed Akram) Owned by: tsabirgaliev (Tair Sabirgaliev)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: tsabirgaliev (Tair Sabirgaliev)
Port: dotnet-sdk-6

Description

When I do:

dotnet tool install --global dotnet-outdated-tool

I get:

/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242: SDK Resolver Failure: "The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed while attempting to resolve the SDK "Microsoft.NET.Sdk". Exception: "System.IO.DirectoryNotFoundException: Could not find a part of the path '/opt/local/share/dotnet/sdk-manifests'.
/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242:    at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242:    at System.IO.Enumeration.FileSystemEnumerator`1.Init()
/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242:    at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)
/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242:    at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242:    at System.IO.Enumeration.FileSystemEnumerableFactory.UserDirectories(String directory, String expression, EnumerationOptions options)
/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242:    at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242:    at System.IO.Directory.GetDirectories(String path, String searchPattern, EnumerationOptions enumerationOptions)
/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242:    at System.IO.Directory.GetDirectories(String path)
/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242:    at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.FallbackForMissingManifest(String manifestId)
/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242:    at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.GetManifestDirectories()
/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242:    at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.GetManifests()+MoveNext()
/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242:    at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.LoadManifestsFromProvider(IWorkloadManifestProvider manifestProvider)
/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242:    at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.Create(IWorkloadManifestProvider manifestProvider, String dotnetRootPath, String sdkVersion, String userProfileDir)
/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242:    at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(String sdkReferenceName, String dotnetRootPath, String sdkVersion, String userProfileDir)
/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242:    at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.WorkloadSdkResolver.Resolve(SdkReference sdkReference, SdkResolverContext resolverContext, SdkResultFactory factory)
/var/folders/mw/d2jp6b715v59p7ghfyp6rr5c0000gn/T/ue0203oo.5gf/restore.csproj(5,31): error MSB4242:    at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.ResolveSdk(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio)""
The tool package could not be restored.
Tool 'dotnet-outdated-tool' failed to install. This failure may have been caused by:

* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.

For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool

Change History (5)

comment:1 Changed 3 years ago by tsabirgaliev (Tair Sabirgaliev)

thanks, will have a look next week

comment:2 Changed 2 years ago by dojoteef (Nader Akoury)

I ran into the same issue. The problem is that the sdk-manifests directory isn't copied in the current Portfile. Here's a short patch that fixed the issue for me:

--- Portfile	2022-05-10 12:53:02.000000000 -0400
+++ Portfile.fixed	2022-05-10 12:40:14.000000000 -0400
@@ -58,10 +58,13 @@
 build {}

 destroot {
+    set dotnet_manifest_version 6.0.200
     set dotnet_home ${prefix}/share/dotnet

-    # Create the target directory
+    # Create the target directories
     xinstall -d ${destroot}${dotnet_home}/sdk
+    xinstall -d ${destroot}${dotnet_home}/sdk-manifests

     move ${worksrcpath}/sdk/${version} ${destroot}${dotnet_home}/sdk
+    move ${worksrcpath}/sdk-manifests/${dotnet_manifest_version} ${destroot}${dotnet_home}/sdk-manifests
 }

NOTE: the manifest version might not be the same as the sdk version (I checked dotnet versions 6.0.201 and 6.0.202 and they both had a manifest version of 6.0.200), that's why there's a separate variable to define the manifest version.

comment:3 Changed 2 years ago by tsabirgaliev (Tair Sabirgaliev)

@dojoteef thank you, I included your suggestions here, also applied to dotnet-sdk-devel: https://github.com/macports/macports-ports/pull/14884

comment:4 Changed 2 years ago by tsabirgaliev (Tair Sabirgaliev)

Resolution: fixed
Status: assignedclosed

In e7a34ab79c4aab1b0d67d67389f02f7e1a7b1bb8/macports-ports (master):

dotnet-sdk-6: include sdk-manifests

Closes: #65082

comment:5 Changed 2 years ago by tsabirgaliev (Tair Sabirgaliev)

In dc78dc97c74bad7fe8b11b01c9b241ea39f8d890/macports-ports (master):

dotnet-sdk-devel: include sdk-manifests

See: #65082

Note: See TracTickets for help on using tickets.