-
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.Traversal conflicts with .NET 8 SDK simplified output paths #509
Comments
Traversal projects don't really produce any output, do you think it would be okay to just disable the simplified output paths feature all together for them? <PropertyGroup>
<UseArtifactsOutput Condition="'$(UseArtifactsOutput)' == ''">false</UseArtifactsOutput>
</PropertyGroup> |
They do produce a variety of outputs, primarily related to the NuGet restore process. While using the Regardless, if the decision is not to support the |
Yes the only real output is the intermediate folder (obj) but the project itself doesn't output anything like an assembly (bin folder). The only other option I can think of is to uniquify the directory name under the
This could end up exceeding path length limits. Alternatively, we could preserve the paths like this:
Does anyone else have a suggestion? |
FWIW this is the workaround I'm using now. It's clearly not quite right for general inclusion because it makes some assumptions, but it may be helpful. It uses the nested directory approach. Note: This is in <Project>
<PropertyGroup>
<!-- Put all artifacts beneath /artifacts instead of project bin/obj directories -->
<ArtifactsPath Condition=" '$(ArtifactsPath)' == '' ">$(MSBuildThisFileDirectory)artifacts\</ArtifactsPath>
</PropertyGroup>
<!-- Avoid conflicts with dirs.proj having the same name -->
<PropertyGroup Condition=" '$(MSBuildProjectFile)' == 'dirs.proj' ">
<_TraversalProjectRelativeToRoot>$([MSBuild]::MakeRelative('$(MSBuildThisFileDirectory)', '$(MSBuildProjectDirectory)'))</_TraversalProjectRelativeToRoot>
<ArtifactsProjectName>dirs\$(_TraversalProjectRelativeToRoot)</ArtifactsProjectName>
</PropertyGroup>
</Project> |
When using the new .NET 8 simplified output paths feature with multiple
dirs.proj
projects usingMicrosoft.Build.Traversal
they conflict with each other. The automaticArtifactsProjectName
determined by the .NET 8 SDK for all of the projects isdirs
so they end up sharing aobj
path within theartifacts
directory, overwriting each other.The only workaround I have found so far is to manually set the
ArtifactsProjectName
differently for each project. However, this must be done before theMicrosoft.Build.Traversal
SDK is imported. This means the simpleSdk="Microsoft.Build.Traversal"
mechanism doesn't work andprops
andtargets
must be imported separately, which is messier and more difficult.The text was updated successfully, but these errors were encountered: