Skip to content

Unknown switch ucr, use-current-runtime not working for restore, build and publish #37567

@travnick

Description

@travnick

Type of issue

Code doesn't work

Description

dotnet restore --ucr false
results with

MSBUILD : error MSB1001: Unknown switch.
    Full command line: 'C:\Program Files\dotnet\sdk\7.0.112\MSBuild.dll -maxcpucount -verbosity:m -nologo -target:Restore --ucr false -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\7.0.112\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\7.0.112\dotnet.dll'
  Switches appended by response files:
Switch: --ucr

For switch syntax, type "MSBuild -help"

dotnet publish --use-current-runtime false looks like not working, since I see logs like

MSBuild version 17.4.8+6918b863a for .NET
  Determining projects to restore...
  1 of 3 projects are up-to-date for restore.
  MyProject -> D:\MyProject\Debug\net6.0\win-x64\MyProject.dll
  MyProject -> D:\MyProject\Debug\net6.0\win-x64\publish\

so it implicitly recognized win-x64 machine, but --use-current-runtime false should prevent this.

Page URL

https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish

Content source URL

https://github.com/dotnet/docs/blob/main/docs/core/tools/dotnet-publish.md

Document Version Independent Id

9439897e-dcb3-bc2e-5cae-35c1ca2e0681

Article author

@tdykstra

Metadata

  • ID: 211afdc7-c796-202d-239d-823f2a499dff
  • Product: dotnet-fundamentals

Associated WorkItem - 190727

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions