dotnet / dotnet/wpf

UseWPF causes that DLLs (Nuget) not copied to output directory (after update to .NET 10)

Open
#11,429 3 comments 1 reaction 0 assignees View on GitHub
External Non-WPF Issue regression
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

Hallo,
I hope this is the right project for this specific issue.

I have solution containing two programs. The main program is a WPF program which contains an UI maintain the configuration. The second program is a console application which is registered as service.
I updated from `.NET 8` to `.NET 10`. Now the console Program fails to run after the build.
```
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Das System kann die angegebene Datei nicht finden.
File name: 'System.Configuration.ConfigurationManager, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
```

The problem is that the DLLs of used NuGet library `System.Configuration.ConfigurationManager` are available in the output folder of the console program. But when the console program is copied to the main program, the used DLLs are missing. This only occurs if the main program has set the `UseWPF`.

I created a small example project:
https://github.com/bit-mschwingenschloegl/UseWPFProblem
Here the second project will run fine in its own output directory. But it will fail if it is executed within the main project output directory due the missing DLLs.

### Reproduction Steps

See example project https://github.com/bit-mschwingenschloegl/UseWPFProblem

1. Build project
2. Try to execute `SecondProject.exe` within the output folder of the main project

### Expected behavior

The required DLLs should be transferred to the main project.

### Actual behavior

The required DLLs are missing

### Regression?

On .NET 8 everything works fine

### Known Workarounds

_No response_

### Impact

_No response_

### Configuration

.NET 10
Windows 11 25H2
x64

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.