-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
.NET 9 SDK WPF build broken with AssemblyName in Directory.Build.props #10068
Comments
I can reproduce the same issue as well. We use WORKAROUND Instead of overriding the AssemblyName in the csproj file, create a Directory.Build.props inside the WPF project and set the AssemblyName there. <Project>
<PropertyGroup>
<AssemblyName>my-wpf-app</AssemblyName>
</PropertyGroup>
</Project> |
For the WPF team: The task |
<IncludePackageReferencesDuringMarkupCompilation>false</IncludePackageReferencesDuringMarkupCompilation> Also fixes the problem. Which means that something in The only real difference I see is how AssemblyName is passed to |
Thank you so much! Just wanted to confirm that this workaround also works for me. I refined the solution a bit with an important of the ancestor
|
Unfortunately this workaround does not work for me. It breaks other things in the build process.
Results in
|
Yeah, I know. I just noted that, so the code owners have a starting point when trying to find out the root cause. |
Description
We have a pretty complex solution with a central
Directory.Build.props
file.This
Directory.Build.props
file contains - among other stuff - aRootNamespace
property that sets a default root namespace according to our conventions.Something similar to this:
The goal of this is that our
.csproj
files have short names without aMyCompanyName.MyProductName.
prefix, but the namespaces and generated assemblies should have this prefix.This worked since years up to .NET SDK 8.0.403. But it's broken since 2024-11-13 when Visual Studio 17.12 (which brings .NET SDK 9.0.100) was installed. It breaks WPF builds if the
Directory.Build.props
file sets aRootNamespace
and/or a customAssemblyName
MSBuild property. It works if the property is moved to the WPF project's.csproj
file. But it really needs to be moved, i.e. removed from the centralDirectory.Build.props
file.Something seems to be broken in the WPF XAML compile process.
As a workaround, I would have to comment out the
<AssemblyName>
property inDirectory.Build.props
, but this would break (or at least change) the output of all our other projects.Reproduction Steps
Please see that attached ZIP file for a minimal repro.
Uncomment the
<AssemblyName>
tag inDirectory.Build.props
and the (clean) build will fail.MyWpfApp.zip
Expected behavior
WPF apps should build without errors in .NET SDK 9 as they did in .NET SDK 8.
Actual behavior
Building with .NET SDK 9 is broken if there is a
Directory.Build.props
file with a custom<AssemblyName>
property.Regression?
Yes, it worked up to .NET SDK 8.0.403. Broken since 9.0.100.
Known Workarounds
No response
Impact
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: