-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Microsoft.Build.Artifacts conflicts with .NET 8 SDK simplified output paths #477
Comments
@jeffkl Any thoughts on how you'd like to solve this conflict? If you have a direction in mind, I'd be happy to open a PR with the required changes. |
The .NET SDK now disables itself if you're using Microsoft.Build.Artifacts: dotnet/sdk#33470 I'm trying to get this pull request to work as well: #458 |
Do you know what version of the .NET 8 SDK should have that change? The merged PR mentions Preview 6, but I'm using RC1, and I'm still seeing the conflict. |
@dsplaisted can you answer @bording's question? #477 (comment) |
@bording I believe the fix went into Preview 6 as mentioned in the PR, but it should definitely be in RC1 in any case. Can you share a repro or a binlog for how you're still seeing the conflict? |
It's happening in https://github.com/Particular/ServiceControl. When I build that with the RC1 SDK, the bin and obj folders end up in the folder configured in
The other potentially relevant piece is that Microsoft.Build.Artifacts is added as a GlobalPackageReference. I can also try and put together a simplified repro if that would also be helpful. |
@dsplaisted Here's a simplified repro: I included a binlog in there as well. When I build that with the RC1 SDK, the configured artifacts folder has both the default artifacts from |
@dsplaisted @jeffkl Anything else I can do to move this forward? |
@bording you can disable Microsoft.Build.Artifacts if you're using the .NET SDK's artifacts functionality: <PropertyGroup>
<EnableArtifacts Condition="'$(UseArtifactsOutput)' == 'true'">false</EnableArtifacts>
</PropertyGroup> Although the .NET SDK's artifacts should be disabling itself if you're using Microsoft.Build.Artifacts. |
@jeffkl I'm not using the .NET SDK artifact functionality, but it's enabled anyway. That's the entire point of the issue I've raised here. Whatever you've done in the SDK so far to try and detect Microsoft.Build.Artifacts is not working. |
Would the opposite work then, disabling .NET SDK's artifacts? <PropertyGroup>
<UseArtifactsOutput>false</UseArtifactsOutput>
</PropertyGroup> |
@jeffkl That does force it off, yes. For now, I'll go ahead and add that to my project that's having the problem as a workaround. However, that doesn't address the larger issue here. According to dotnet/sdk#33470, the SDK is supposed to detect Microsoft.Build.Artifacts and automatically disable the SDK artifacts. That detection is not working properly, so it seems like something that should be investigated and fixed. |
Reading through the changes and comments in dotnet/sdk#33470, I believe this is happening in my case because of the scenario being talked about in dotnet/sdk#33470 (comment) I do think something more needs to be done in the SDK to cover that scenario as well. |
Got it, I think we'll need to open an issue at https://github.com/dotnet/sdk/issues/new/choose instead, this issue is about Microsoft.Build.Artifacts disabling itself when the .NET SDK's functionality is enabled. |
Maybe you're thinking about a different issue? This is the issue I opened about the conflict. |
Due to the order things are imported in, I'm not sure we can make this work without requiring the Directory.Build.props to set So I think the guidance should be, that if you're referencing Microsoft.Build.Artifacts as a NuGet package, and you are setting |
If it's not actually possible to resolve the conflict between the shared use of Instead, I think it makes more sense to go ahead and take a breaking change in a new major version of Microsoft.Build.Artifacts and have it use a different property name, for example That was what I was going to suggest doing when I opened this issue before learning that there was an attempt to modify the SDK. |
The .NET 8 SDK has a new simplified output paths feature that is opt-in.
However, the property that has been chosen to configure it is
ArtifactsPath
.That leads to any projects using Microsoft.Build.Artifacts that are built with the .NET 8 SDK to suddenly find bin and obj folders in the build artifacts folder.
The text was updated successfully, but these errors were encountered: