Skip to content

Missing PackageDefinitions metadata after 7.0.200 update #30809

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

Closed
SergeyRazmyslov opened this issue Feb 23, 2023 · 3 comments
Closed

Missing PackageDefinitions metadata after 7.0.200 update #30809

SergeyRazmyslov opened this issue Feb 23, 2023 · 3 comments
Assignees
Labels
breaking-change Using this label will notify dotnet/compat and trigger a request to file a compat bug
Milestone

Comments

@SergeyRazmyslov
Copy link

Describe the bug

PackageDefinitions metadata disappeared after upgrade SDK to version 7.0.200.

To Reproduce

Add the following target to any C# project file:

	<Target Name="PrintDependencies" BeforeTargets="BeforeBuild" DependsOnTargets="RunResolvePackageDependencies">
		<PropertyGroup>
			<AllDependencies>@(PackageDefinitions, '; ')</AllDependencies>
		</PropertyGroup>
		<Message Text="Dependencies: $(AllDependencies)" Importance="high" />
		<Error Text="No dependencies found" Condition="'$(AllDependencies)' == ''" />
	</Target>

Previous SDK version works as expected:

dotnet --version
7.0.102

dotnet build "C:\Projects\ClassLibrary1\ClassLibrary1.sln"
MSBuild version 17.4.1+9a89d02ff for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  Dependencies: Microsoft.NETCore.Platforms/1.1.0; NETStandard.Library/2.0.3
  ClassLibrary1 -> C:\Projects\ClassLibrary1\ClassLibrary1\bin\Debug\netstandard2.0\ClassLibrary1.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

The same project has different build result after SDK upgrade:

dotnet --version
7.0.200

dotnet build "C:\Projects\ClassLibrary1\ClassLibrary1.sln"
MSBuild version 17.5.0-preview-23061-01+040e2a90e for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  Dependencies:
C:\Projects\ClassLibrary1\ClassLibrary1\ClassLibrary1.csproj(12,3): error : No dependencies found

Build FAILED.

C:\Projects\ClassLibrary1\ClassLibrary1\ClassLibrary1.csproj(12,3): error : No dependencies found
    0 Warning(s)
    1 Error(s)

Exceptions (if any)

Further technical details

dotnet --info
.NET SDK:
 Version:   7.0.200
 Commit:    534117727b

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22621
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.200\

Host:
  Version:      7.0.3
  Architecture: x64
  Commit:       0a2bda10e8

.NET SDKs installed:
  3.1.426 [C:\Program Files\dotnet\sdk]
  6.0.309 [C:\Program Files\dotnet\sdk]
  6.0.406 [C:\Program Files\dotnet\sdk]
  7.0.200 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Microsoft Visual Studio Version 17.5.0

@ericstj
Copy link
Member

ericstj commented Feb 23, 2023

It seems like this was caused by #28405

@ocallesp @dsplaisted @marcpopMSFT - do you have a breaking change doc for this?

Also it might be interesting to look at the scenario here and provide a recommendation for @SergeyRazmyslov that doesn't need to set EmitLegacyAssetsFileItems. Can he leverage whatever the design time build is using?

@marcpopMSFT
Copy link
Member

At the time it was implemented, we didn't think it was a breaking change as that was a change to internal implementation. @dsplaisted may be worth a breaking change doc as this is the second report I've seen of this change impacting someone.

@marcpopMSFT marcpopMSFT added the untriaged Request triage from a team member label Mar 8, 2023
@marcpopMSFT marcpopMSFT self-assigned this Mar 8, 2023
@marcpopMSFT marcpopMSFT added needs team triage Requires a full team discussion breaking-change Using this label will notify dotnet/compat and trigger a request to file a compat bug and removed untriaged Request triage from a team member needs team triage Requires a full team discussion labels Mar 8, 2023
@marcpopMSFT marcpopMSFT added this to the Discussion milestone Mar 8, 2023
@marcpopMSFT
Copy link
Member

With the breaking change issue filed, I'm going to close this out with the recommendation to use EmitLegacyAssetsFileItems to get the old behavior. We should have documented this already but didn't anticipate others using this information.

@marcpopMSFT marcpopMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Using this label will notify dotnet/compat and trigger a request to file a compat bug
Projects
None yet
Development

No branches or pull requests

3 participants