dotnet / Nerdbank.GitVersioning

Stamp your assemblies, packages and more with a unique version generated from a single, simple version.json file and include git commit IDs for non-official builds.
https://www.nuget.org/packages/Nerdbank.GitVersioning
MIT License
1.32k stars 165 forks source link

Warning about PrivateP2PCaching.proj #1040

Closed thomas-ravkilde closed 1 month ago

thomas-ravkilde commented 3 months ago

I have the same issue as #787. If I understand correctly, this issue should have been circumvented for v3.6 by #847. However, I still get the issue with v3.6.133. I'm not using a graph build, AFAIK:

Directory.Build.props:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
      <PrivateAssets>all</PrivateAssets>
      <Version>3.6.133</Version>
    </PackageReference>
  </ItemGroup>
</Project>
AArnott commented 3 months ago

Code inspection suggests that the fix is in fact present in 3.6.133. I'm going to need more information for this to be actionable. Where are you seeing the warning? What version of the software are you on? Can you share a minimal repro?

thomas-ravkilde commented 3 months ago

Where are you seeing the warning?

I'm seeing the warning in the Error List on build in Visual Studio Community 2022 (64-but), v17.9.2.

image

What version of the software are you on?

Here are the full installation specs:

Microsoft Visual Studio Community 2022
Version 17.9.2
VisualStudio.17.Release/17.9.2+34622.214
Microsoft .NET Framework
Version 4.8.03761

Installed Version: Community

ASP.NET and Web Tools   17.9.197.37128
ASP.NET and Web Tools

Azure App Service Tools v3.0.0   17.9.197.37128
Azure App Service Tools v3.0.0

C# Tools   4.9.0-3.24121.1+a98c90d56455379836dd5c845b35fa932b00cfa3
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

NuGet Package Manager   6.9.1
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

TypeScript Tools   17.0.30103.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   4.9.0-3.24121.1+a98c90d56455379836dd5c845b35fa932b00cfa3
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools   17.9.0-beta.23614.3+a521e1cd420beb56c15faf6836184fadd2b7937a
Microsoft Visual F# Tools

Visual Studio IntelliCode   2.2
AI-assisted development for Visual Studio.

Can you share a minimal repro?

Hopefully this can help: src.zip

thomas-ravkilde commented 3 months ago

Note that the warnings show up for .NET Framework 4.8 projects but not .NET 8.0 projects. I think, I forgot to mention that.

AArnott commented 3 months ago

Great. That last clue is perhaps the most important. I'll give a repro a try. My original fix should have been plenty adequate, but I have a guess as to why it didn't work for non-SDK style projects in VS and an idea of how to fix it.

thomas-ravkilde commented 3 months ago

Sound great. Let me know if you need me to test anything.