Skip to content

dotnet publish --os Linux in .NET 7 references .NET 6 #28350

@TanayParikh

Description

@TanayParikh
@TanayParikh ➜ /workspaces $ dotnet new console -o console
The template "Console App" was created successfully.

Processing post-creation actions...
Restoring /workspaces/console/console.csproj:
  Determining projects to restore...
  Restored /workspaces/console/console.csproj (in 0.7 ms).
Restore succeeded.


@TanayParikh ➜ /workspaces $ cd console/
@TanayParikh ➜ /workspaces/console $ dotnet publish console.csproj --os linux
Unhandled exception: System.IO.DirectoryNotFoundException: Could not find a part of the path '/usr/local/dotnet/6/dotnet/sdk'.
   at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
   at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
   at System.IO.Enumeration.FileSystemEnumerableFactory.UserDirectories(String directory, String expression, EnumerationOptions options)
   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
   at System.IO.Directory.GetDirectories(String path, String searchPattern, EnumerationOptions enumerationOptions)
   at Microsoft.DotNet.Cli.CommonOptions.GetCurrentRuntimeId()
   at Microsoft.DotNet.Cli.CommonOptions.ResolveRidShorthandOptionsToRuntimeIdentifier(String os, String arch)
   at Microsoft.DotNet.Cli.CommonOptions.ResolveRidShorthandOptions(String os, String arch, Boolean userSpecifiedSelfContainedOption)
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Microsoft.DotNet.Tools.Publish.PublishCommand.FromParseResult(ParseResult parseResult, String msbuildPath)
   at Microsoft.DotNet.Tools.Publish.PublishCommand.Run(ParseResult parseResult)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.DotNet.Cli.Parser.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__17_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass15_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass7_0.<<UseExceptionHandler>b__0>d.MoveNext()
@TanayParikh ➜ /workspaces/wasmhosted $ dotnet --version
7.0.100-rtm.22505.9
@TanayParikh ➜ /workspaces/wasmhosted $ dotnet publish Server/wasmhosted.Server.csproj --os linux
Unhandled exception: System.IO.DirectoryNotFoundException: Could not find a part of the path '/usr/local/dotnet/6/dotnet/sdk'.
   at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
   at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
   at System.IO.Enumeration.FileSystemEnumerableFactory.UserDirectories(String directory, String expression, EnumerationOptions options)
   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
   at System.IO.Directory.GetDirectories(String path, String searchPattern, EnumerationOptions enumerationOptions)
   at Microsoft.DotNet.Cli.CommonOptions.GetCurrentRuntimeId()
   at Microsoft.DotNet.Cli.CommonOptions.ResolveRidShorthandOptionsToRuntimeIdentifier(String os, String arch)
   at Microsoft.DotNet.Cli.CommonOptions.ResolveRidShorthandOptions(String os, String arch, Boolean userSpecifiedSelfContainedOption)
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Microsoft.DotNet.Tools.Publish.PublishCommand.FromParseResult(ParseResult parseResult, String msbuildPath)
   at Microsoft.DotNet.Tools.Publish.PublishCommand.Run(ParseResult parseResult)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.DotNet.Cli.Parser.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__17_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass15_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass7_0.<<UseExceptionHandler>b__0>d.MoveNext()

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions