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 BaseIntermediatePath for project.assets.json #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iskiselev
Copy link

project.assets.json located in $(BaseIntermediatePath), which is obj by default. It can be overriden. In that case, BlackDuck fail to find it and properly scan project.
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>
    <BaseIntermediateOutputPath>..\..\output\tmp\Common\$(ProjPart)</BaseIntermediateOutputPath>
  </PropertyGroup>
</Project>
  • IntermediateBase.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!");

That fix is dirty and does not solve few problems:

  • BaseIntermediateOutputPath may depends on Configuration
  • .csproj.nuget.g.props also locatied in BaseIntermediateOutputPath, so code should properly handle it if reading of nuget.g.props is required

@devmehtabd
Copy link
Collaborator

Thank you for putting forth this PR. This definitely is a valid and an important use case that we would like our Inspector to support. But along with this change, we would like to enhance this further by adding support for .csproj.nuget.g.props file and reach to a conclusion for another use case related to our Inspector ( for which I would spare you the details). We would be keeping this PR open until someone from the dev team can pick this back up.

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