put on Azure pos4-epcggvc8g7hgghd3.southafricanorth-01.azurewebsites.net https://github.com/Thibaut501/POSJOSEA

Thibaut Fabrice 0 Reputation points
2026-04-10T08:40:09.9666667+00:00

Run dotnet restore POSJOSEA.csproj --framework net10.0-windows10.0.19041.0

MSBUILD : error MSB1001: Unknown switch.

Full command line: 'C:\Program Files\dotnet\sdk\10.0.201\MSBuild.dll -maxcpucount --verbosity:m -tlp:default=auto --property:NuGetInteractive=false --target:Restore --verbosity:minimal --nologo POSJOSEA.csproj --framework net10.0-windows10.0.19041.0 -distributedlogger:Microsoft.DotNet.Cli.Commands.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\10.0.201\dotnet.dll*Microsoft.DotNet.Cli.Commands.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\10.0.201\dotnet.dll'

Switches appended by response files:

Switch: --framework

For switch syntax, type "MSBuild -help"

Error: Process completed with exit code 1.User's image

Window Machine to run.not showing right page.

https://github.com/Thibaut501/POSJOSEA

Awaiting your reply,

Fabrice

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.


1 answer

Sort by: Newest
  1. AI answer

    2026-04-10T08:40:31.5566667+00:00

    The error occurs because dotnet restore is forwarding the --framework switch to MSBuild, but MSBuild doesn’t recognize --framework as a valid switch. In the full command line shown, --framework net10.0-windows10.0.19041.0 appears after the project file, so MSBuild treats it as its own switch and fails with MSB1001: Unknown switch.

    To restore and build successfully for Azure App Service, use only switches that MSBuild supports and keep dotnet-only options on the dotnet side of the command.

    1. Run restore using dotnet with the framework option (this is a dotnet restore option, not an MSBuild one):
         dotnet restore POSJOSEA.csproj -f net10.0-windows10.0.19041.0
      
      or, if using the long form:
         dotnet restore POSJOSEA.csproj --framework net10.0-windows10.0.19041.0
      
      Ensure that no response file (*.rsp) is appending --framework directly to the MSBuild invocation.
    2. If a response file is in use (for example MSBuild.rsp or Directory.Build.rsp), remove the --framework entry from that file, because response files must contain only valid MSBuild switches. If needed, disable automatic response files for a test run:
         msbuild POSJOSEA.csproj -noAutoResponse
      
      The -noAutoResponse switch tells MSBuild not to load MSBuild.rsp or Directory.Build.rsp automatically.
    3. After a successful restore, publish for Azure App Service using dotnet publish or the Azure DevOps/ GitHub Actions task, again ensuring that only valid MSBuild switches are passed through.

    Once the app is successfully built and published to the App Service, the default “Your web app is running and waiting for your content” page will be replaced by the application’s content.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.