Skip to content
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

Use SetGlobalProperty for updating $(Configuration) #23

Closed
wants to merge 1 commit into from

Conversation

iskiselev
Copy link

Config property is not used for output path calculation when output path is overriden.

To reproduce it, use next project:

  • Directory.Build.props:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <ProjPart Condition="'$(ProjPart)' == ''">$([MSBuild]::MakeRelative($(MSBuildThisFileDirectory),$(MSBuildProjectDirectory)))\$([System.IO.Path]::GetFileNameWithoutExtension($(MSBuildProjectFile)))</ProjPart>
    <OutputPath>..\..\output\bin\$(Configuration)\$(ProjPart)</OutputPath>
  </PropertyGroup>
</Project>
  • Normal.csproj:
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFrameworks>net8.0;net7.0</TargetFrameworks>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <JsonVersion>13.0.3</JsonVersion>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="$(JsonVersion)" />
  </ItemGroup>

</Project>
  • Program.cs
Console.WriteLine("Hello, World!");

Using SetGlobalProperty fixes the issue

@devmehtabd
Copy link
Collaborator

Thank you for putting forth this PR for us. But, after thorough investigation and understanding the use of Config Property, we feel that this block of code is not used by our Nuget Inspector to derive dependencies. We just use configuration to calculate the output paths but never use them further, so we would be putting forward a tech debt to remove this block of code for finding output paths and focus on getting BaseIntermediateOutputPath as described in this PR: #22.

Closing this PR.

@devmehtabd devmehtabd closed this Oct 31, 2024
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.

2 participants