Closed nil4 closed 9 hours ago
Cc @dotnet/dotnet-wpf for triage
@baronfel appreciate the quick turn-around time!
I updated the script to also check WinForms rather than WPF projects, and the exact same issue reproduces there as well. Here is the diff for reference:
diff --git a/repro.ps1 b/repro.ps1
index f52981b..441c750 100644
--- a/repro.ps1
+++ b/repro.ps1
@@ -42,18 +42,11 @@ function repro_with_dotnet([int]$dotnetVersion) {
$fx = "net${dotnetVersion}.0"
Write-Host "Testing ${fx} repro under ${reproDir}" -ForegroundColor Cyan
- Write-Host "Creating new ${fx} WPF project in ${reproDir}" -ForegroundColor Cyan
+ Write-Host "Creating new ${fx} WinForms project in ${reproDir}" -ForegroundColor Cyan
remove_dir $reproDir
- & dotnet.exe new wpf --framework $fx --output $reproDir
+ & dotnet.exe new winforms --framework $fx --output $reproDir
- # disable implicit usings -- prevents `Application` in App.xaml.cs being ambiguous between WPF and WinForms
- Write-Host "Disabling <ImplicitUsings> in ${reproDir}\${name}.csproj" -ForegroundColor Cyan
-
- [string]$csprojContent = Get-Content "${reproDir}\${name}.csproj" -Raw -Encoding utf8
- $csprojContent = $csprojContent.Replace('<ImplicitUsings>enable<', '<ImplicitUsings>disable<')
- Set-Content "${reproDir}\${name}.csproj" $csprojContent -Encoding utf8
-
Push-Location $reproDir
try {
add_package 'DevExpress.Mvvm' '24.1.5' $DX_NUGET_API
I will update the title to not suggest that this is WPF-specific (or WPF-only.)
Thanks for creating this issue! We believe this issue is related to NuGet tooling, which is maintained by the NuGet team. Thus, we closed this one and encourage you to raise this issue in the NuGet repository instead. Don’t forget to check out NuGet’s contributing guide before submitting an issue!
If you believe this issue was closed out of error, please comment to let us know.
Happy Coding!
The regression observed is about assemblies missing in the output of dotnet publish
using .NET 9.0 RC1. If it is believed that this is about NuGet packages, it would be helpful to add some more details before closing the issue or redirecting to another repo.
Hence I believe this issue was closed in error, and kindly request it be re-opened and triaged. Thank you in advance!
Yes, the auto-tagging is somewhat generous in what it considers a NuGet issue. I'll remove that tag and reopen.
We don't have a 'WPF' or 'Windows' area path (cc @marcpopMSFT should we?) so I've tagged it Area-NetSDK for now until we find the proper owner.
@nil4 could you please share a placeholder subscription for devexpress over my email, so that i can repro and check this? I tried to repro this without the devexpress references and couldn't repro.
@singhashish-wpf thank you for taking a look at this puzzling issue! Indeed, with just the DevExpress packages referenced, or just the Tulpep
package referenced, publishing works on .NET 9. Only when they both are present does the issue occur.
I am checking with the account owner if sharing the subscription details is possible, but I expect this will take a while to review and clear.
Perhaps the https://www.devexpress.com/Products/Try/ option might be helpful in the meanwhile? I think requesting a trial might grant temporary access to the NuGet feed relevant for repro:
NuGet Feed (for all .NET products/libraries)
If you'd like to install our 30-day trial using a NuGet feed, simply click the button to the right. With a NuGet feed, you can receive automatic package updates, and can optimize build/test processes via CI/CD tools approved within your enterprise.
cc: @merriemcgaw
@singhashish-wpf here is a simpler way to repro: download the Unified Component Installer from https://www.devexpress.com/Products/Try/ and select Winforms and WPF components to be installed.
This downloads and places the NuGet packages relevant to the repro under C:\Program Files\DevExpress 24.1\Components\System\Components\packages
Update the repro script to use that directory as its NuGet source:
diff --git a/repro.ps1 b/repro.ps1
index f52981b..debfe10 100644
--- a/repro.ps1
+++ b/repro.ps1
@@ -4,10 +4,7 @@ $ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
$PSStyle.OutputRendering = 'ANSI'
-# Configure a DevExpress subscription/API key here
-$DX_SUBSCRIPTION = '!!!! Add-DevExpress-Subscription-Key-Here !!!!'
-
-$DX_NUGET_API = "https://nuget.devexpress.com/${DX_SUBSCRIPTION}/api/v3/index.json"
+$DX_NUGET_API = 'C:\Program Files\DevExpress 24.1\Components\System\Components\packages'
$NUGET_API = 'https://api.nuget.org/v3/index.json'
function add_package([string]$package, [string]$version, [string]$sourceUrl) {
On my machine, using these local packages still reproduces the issue as originally reported. I hope this helps.
We don't have a 'WPF' or 'Windows' area path (cc @marcpopMSFT should we?) so I've tagged it Area-NetSDK for now until we find the proper owner.
@baronfel I believe most WD issues get moved out of the repo so we've never had a need for the area label. Is this one going to need a fix in the SDK repo?
I'm not sure - it's unclear if the problem is something in publish we've done, or something in the framework/sdk packages that are being used here. Looks like the WD team is on it though (thanks folks!)
@baronfel @rainersigwald I have uploaded binlogs for your reference for both NET9(fail) and NET8(pass).
Good see that the issue is repeatable at your end -- thanks @singhashish-wpf
This should be fixed in .NET 9 RC2.
I think adding this to the project file should workaround the issue:
<ItemGroup>
<FrameworkReference Include="Microsoft.WindowsDesktop.App.WPF" />
<FrameworkReference Include="Microsoft.WindowsDesktop.App.WindowsForms" />
</ItemGroup>
Much appreciated, @dsplaisted -- thank you!
Describe the bug
A WPF project using DevExpress components, WCF and a handful of third-party NuGet packages can be published self-contained correctly when targeting
net8.0-windows
. All relevant.dll
files are present in the published output, and the application runs as expected.When the project is re-targeted to
net9.0-windows
, the self-contained publish output no longer includes certain WPF assemblies (e.g.PresentationCore.dll
orPresentationFramework*.dll
) The published application now crashes at startup because it cannot find these WPF assemblies.The steps provided below are a minimal reproducible example extracted from the actual application.
To Reproduce
Note: an active subscription for access to the DevExpress NuGet package source
https://nuget.devexpress.com/${YOUR_SUBSCRIPTION_KEY_HERE}/api/v3/index.json
will be required.Download the script at https://gist.github.com/nil4/9f6c787205340b8b45a7cfe504ba7400 and on line 8, replace the placeholder value with a DevExpress subscription key.
Running the script (
pwsh repro.ps1
) will:Presentation*.dll
)The script creates two projects, first targeting
net8.0
and thennet9.0
. The publish output fornet8.0
consistently includes the WPF assemblies.The publish output for
net9.0
, once the final NuGet package reference is added, no longer includes the expected WPF assemblies.This appears to be a regression, and an unexpected breaking change in .NET 9.0 RC1.
net8.0
publishing correctlynet9.0
missing expected outputFurther technical details
dotnet --info
``` .NET SDK: Version: 9.0.100-rc.1.24452.12 Commit: 81a714c6d3 Workload version: 9.0.100-manifests.a7bf2b8f MSBuild version: 17.12.0-preview-24422-09+d17ec720d Runtime Environment: OS Name: Windows OS Version: 10.0.22621 OS Platform: Windows RID: win-arm64 Base Path: C:\Program Files\dotnet\sdk\9.0.100-rc.1.24452.12\ Host: Version: 9.0.0-rc.1.24431.7 Architecture: arm64 Commit: static .NET SDKs installed: 8.0.400 [C:\Program Files\dotnet\sdk] 9.0.100-rc.1.24452.12 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 9.0.0-rc.1.24452.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 9.0.0-rc.1.24431.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 9.0.0-rc.1.24452.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Other architectures found: x64 [C:\Program Files\dotnet\x64] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x64\InstallLocation] x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation] Environment variables: Not set global.json file: Not found ```The repro script for reference:
repro.ps1
```pwsh #Requires -PSEdition Core -Version 7.4 Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' $PSNativeCommandUseErrorActionPreference = $true $PSStyle.OutputRendering = 'ANSI' # Configure a DevExpress subscription/API key here $DX_SUBSCRIPTION = '!!!! Add-DevExpress-Subscription-Key-Here !!!!' $DX_NUGET_API = "https://nuget.devexpress.com/${DX_SUBSCRIPTION}/api/v3/index.json" $NUGET_API = 'https://api.nuget.org/v3/index.json' function add_package([string]$package, [string]$version, [string]$sourceUrl) { Write-Host "Adding package ${package} ${version} in ${PWD}" -ForegroundColor Cyan & dotnet.exe add package $package --version $version --no-restore --source $sourceUrl } function remove_dir([string]$dir) { if (Test-Path $dir -PathType Container) { Remove-Item $dir -Force -Recurse } } function publish_and_test([string]$publishDir) { Write-Host "Publishing ${PWD} to ${publishDir}" -ForegroundColor Cyan remove_dir $publishDir & dotnet.exe publish --self-contained --runtime win-x64 --output $publishDir --nologo $expectedFiles = Get-Item "${publishDir}\Presentation*.dll" $count = ($expectedFiles | Measure-Object).Count if ($count -gt 0) { Write-Host "✅ Found ${count} files matching ${publishDir}\Presentation*.dll" -ForegroundColor Green } else { Write-Host "⛔ Found NO files matching ${publishDir}\Presentation*.dll" -ForegroundColor Red } } function repro_with_dotnet([int]$dotnetVersion) { $name = "repro_${dotnetVersion}" $reproDir = "$PSScriptRoot\${name}" $fx = "net${dotnetVersion}.0" Write-Host "Testing ${fx} repro under ${reproDir}" -ForegroundColor Cyan Write-Host "Creating new ${fx} WPF project in ${reproDir}" -ForegroundColor Cyan remove_dir $reproDir & dotnet.exe new wpf --framework $fx --output $reproDir # disable implicit usings -- prevents `Application` in App.xaml.cs being ambiguous between WPF and WinForms Write-Host "Disabling