Skip to content

dotnet.py: --output is no longer supported with dotnet build/publish#2774

Merged
radical merged 1 commit intodotnet:mainfrom
radical:fix-build-sln
Dec 7, 2022
Merged

dotnet.py: --output is no longer supported with dotnet build/publish#2774
radical merged 1 commit intodotnet:mainfrom
radical:fix-build-sln

Conversation

@radical
Copy link
Copy Markdown
Member

@radical radical commented Dec 7, 2022

.. with .sln files. Instead, pass /p:PublishDir=.. to the build command.

This changed in dotnet/sdk#29065, and broke dotnet-runtime-perf pipeline's blazor scenarios.

$ dotnet publish /home/helixbot/work/A8850905/p/performance/src/scenarios/blazorpizza/app/BlazingPizza.sln --configuration Release --output pub /p:NuGetPackageRoot=/home/helixbot/work/A8850905/w/A9A608EA/u/artifacts/packages/ /p:UseSharedCompilation=false /p:BuildInParallel=false /m:1 --framework net7.0 /p:_TrimmerDumpDependencies=true -bl:./traces/blazor_publish.binlog -p:WasmNativeWorkload=false
MSBuild version 17.5.0-preview-22601-03+a2490dd3f for .NET

/home/helixbot/work/A8850905/p/dotnet/sdk/8.0.100-alpha.1.22606.3/Current/SolutionFile/ImportAfter/Microsoft.NET.Sdk.Solution.targets(36,5):
    error NETSDK1194: The "--output" option isn't supported when building a solution. [/home/helixbot/work/A8850905/p/performance/src/scenarios/blazorpizza/app/BlazingPizza.sln]

Fixes dotnet/runtime#79330 .

@radical radical added the pipeline blocker issue blocks perf pipeline stays green. This be considered high priority. label Dec 7, 2022
.. with .sln files. Instead, pass `/p:PublishDir=..` to the build
command.

This changed in dotnet/sdk#29065, and broke
`dotnet-runtime-perf` pipeline's blazor scenarios.

```
$ dotnet publish /home/helixbot/work/A8850905/p/performance/src/scenarios/blazorpizza/app/BlazingPizza.sln --configuration Release --output pub /p:NuGetPackageRoot=/home/helixbot/work/A8850905/w/A9A608EA/u/artifacts/packages/ /p:UseSharedCompilation=false /p:BuildInParallel=false /m:1 --framework net7.0 /p:_TrimmerDumpDependencies=true -bl:./traces/blazor_publish.binlog -p:WasmNativeWorkload=false
MSBuild version 17.5.0-preview-22601-03+a2490dd3f for .NET

/home/helixbot/work/A8850905/p/dotnet/sdk/8.0.100-alpha.1.22606.3/Current/SolutionFile/ImportAfter/Microsoft.NET.Sdk.Solution.targets(36,5):
    error NETSDK1194: The "--output" option isn't supported when building a solution. [/home/helixbot/work/A8850905/p/performance/src/scenarios/blazorpizza/app/BlazingPizza.sln]
```

Details:

When building a solution, passing a relative path to `PublishDir` gets
evaluated per-project. So, if we pass `-p:PublishDir=pub` then we get
`pub/` sub-directories for each of the projects.

But when used with `--output pub`, output for all the projects goes to
the same directory. To have the same behavior use an absolute path.
@radical
Copy link
Copy Markdown
Member Author

radical commented Dec 7, 2022

@radical radical marked this pull request as ready for review December 7, 2022 08:18
@radical
Copy link
Copy Markdown
Member Author

radical commented Dec 7, 2022

Without this the dotnet-runtime-perf pipeline is broken for blazor scenarios.

Copy link
Copy Markdown
Member

@LoopedBard3 LoopedBard3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, once the test run finishes. Does this also need to be backported to release7.0?

@radical
Copy link
Copy Markdown
Member Author

radical commented Dec 7, 2022

Does this also need to be backported to release7.0?

The change seems to be only in the 8.0 sdk.

@radical radical merged commit def4ce2 into dotnet:main Dec 7, 2022
@radical radical deleted the fix-build-sln branch December 7, 2022 18:25
@radical radical removed the pipeline blocker issue blocks perf pipeline stays green. This be considered high priority. label Dec 7, 2022
NielsPilgaard added a commit to NielsPilgaard/EventStore-Client-Dotnet that referenced this pull request Feb 16, 2023
This fixes publish failing with the error `error NETSDK1194: The "--output" option isn't supported when building a solution.`

The `--output` flag has been deprecated, the recommended approach is to use `/p:PublishDir=..` instead.
Reference: dotnet/performance#2774
@zzvara
Copy link
Copy Markdown

zzvara commented Feb 21, 2023

@LoopedBard3 @radical this is also an issue in .NET 7. We upgraded our CI build image running on Azure DO, which bumped to a newer .NET 7 patch version. The same build where only the underlying build image has changed a patch version of .NET 7 now fails.

/usr/share/dotnet/sdk/7.0.200/Current/SolutionFile/ImportAfter/Microsoft.NET.Sdk.Solution.targets(36,5): Error NETSDK1194: The "--output" option isn't supported when building a solution.

Edit.

It seems that this is actually expected.

.NET 7.0.200 SDK and later

If you specify the --output option when running this command on a solution, the CLI will emit an error due to the unclear semantics of the output path. The --output option is disallowed because all outputs of all built projects would be copied into the specified directory, which isn't compatible with multi-targeted projects, as well as projects that have different versions of direct and transitive dependencies.

nkz-soft added a commit to nkz-soft/microservice-template that referenced this pull request Feb 23, 2023
timothycoleman pushed a commit to kurrent-io/KurrentDB-Client-Dotnet that referenced this pull request Feb 27, 2023
* Added 3 overloads of `AddEventStoreClient`

These new methods provide access to the `IServiceProvider`, allowing easy configuration across environments.
This is very useful when using EventStore on different environments, that use different EventStores.

I currently have this code running in production, and it works very well in combination with a configuration manager such as Azure App Configuration, or Azure Key Vault.

They allow constructing the following using the ServiceProvider:
- Uri address
- string connectionString
- Action<EventStoreClientSettings` configureSettings

I've also added:
- 2 new private methods that do the actual registration
- tests for all 3 public methods

* Replace --output flag with /p:PublishDir

This fixes publish failing with the error `error NETSDK1194: The "--output" option isn't supported when building a solution.`

The `--output` flag has been deprecated, the recommended approach is to use `/p:PublishDir=..` instead.
Reference: dotnet/performance#2774

* create packages folder if it doesn't exist before running `dotnet pack`
andrewlock added a commit to andrewlock/NetEscapades.EnumGenerators that referenced this pull request Mar 6, 2023
andrewlock added a commit to andrewlock/NetEscapades.EnumGenerators that referenced this pull request Mar 6, 2023
* Add integration test for netstandard

* Fix publish command: dotnet/performance#2774
ProActive-Engineer added a commit to ProActive-Engineer/NetEscapades.EnumGenerators that referenced this pull request Aug 19, 2023
* Add integration test for netstandard

* Fix publish command: dotnet/performance#2774
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[wasm] Blazor scenarios broken on dotnet-runtime-perf

3 participants