Files
ILSpy/ILSpy.BamlDecompiler.Tests.Windows/ILSpy.BamlDecompiler.Tests.Windows.csproj
Siegfried Pammer f1bc6ab542 Fix #1688: resolve elements to the XML namespace the document declares
An assembly can map one CLR namespace to several XML namespaces: PresentationFramework
maps its namespaces to both the winfx/2006 and the netfx/2007 presentation namespace. The
fallback used when the BAML xmlns records name no namespace for a type always preferred the
winfx/2006 one, so a document that binds the default prefix to netfx/2007 ended up with a
root start tag that declares one presentation namespace and needs the other for its own
name, which XmlWriter rejects. Only the root carries the xmlns declaration, which is why
skipping XClassRewritePass worked around it.

Assisted-by: Claude:claude-opus-5:Claude Code
2026-09-01 06:49:23 +02:00

144 lines
5.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsWindowsX64 Condition="$([MSBuild]::IsOsPlatform('Windows')) And $([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture) == X64">true</IsWindowsX64>
<IsWindowsARM64 Condition="$([MSBuild]::IsOsPlatform('Windows')) And $([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture) == ARM64">true</IsWindowsARM64>
</PropertyGroup>
<PropertyGroup>
<!-- The BAML round-trip cases compile WPF XAML into this assembly, so the project is
Windows-bound (built and run only in the Windows CI leg via ILSpy.sln). EnableWindowsTargeting
lets the package graph restore on non-Windows hosts, so the lock file can be generated and
verified anywhere even though the tests themselves only execute on Windows. -->
<TargetFramework>net11.0-windows</TargetFramework>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<UseWpf>true</UseWpf>
<!-- RID-complete lock so the committed packages.lock.json matches regardless of the host that
restores it; the concrete RuntimeIdentifier gives BamlTestRunner the bin\...\<rid> layout
it walks up from to find the .xaml sources. -->
<RuntimeIdentifiers>win-x64;win-arm64;linux-x64;osx-arm64</RuntimeIdentifiers>
<RuntimeIdentifier Condition="$(IsWindowsX64) == true">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="$(IsWindowsARM64) == true">win-arm64</RuntimeIdentifier>
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
<EnableDefaultItems>false</EnableDefaultItems>
<ExtrasEnableDefaultPageItems>false</ExtrasEnableDefaultPageItems>
<ExtrasEnableDefaultResourceItems>false</ExtrasEnableDefaultResourceItems>
<AutoGenerateBindingRedirects>True</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="AwesomeAssertions" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" />
<PackageReference Include="Microsoft.Testing.Extensions.VSTestBridge" />
<PackageReference Include="coverlet.MTP" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ICSharpCode.Decompiler.Tests\ICSharpCode.Decompiler.Tests.csproj" />
<ProjectReference Include="..\ICSharpCode.BamlDecompiler\ICSharpCode.BamlDecompiler.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Include="BamlSecurityTests.cs" />
<Compile Include="BamlTestRunner.cs" />
<Compile Include="Cases\AttachedEvent.xaml.cs">
<DependentUpon>AttachedEvent.xaml</DependentUpon>
</Compile>
<Compile Include="Cases\CustomControl.cs" />
<Compile Include="Cases\Issue1547.xaml.cs" />
<Compile Include="Cases\Issue1688.xaml.cs">
<DependentUpon>Issue1688.xaml</DependentUpon>
</Compile>
<Compile Include="Cases\Issue2097.xaml.cs" />
<Compile Include="Cases\Issue2116.xaml.cs" />
<Compile Include="Cases\Issue3318.xaml.cs" />
<Compile Include="Cases\MyControl.xaml.cs">
<DependentUpon>MyControl.xaml</DependentUpon>
</Compile>
<Compile Include="Cases\ReadonlyProperty.xaml.cs" />
<Compile Include="Cases\Resources.xaml.cs">
<DependentUpon>Resources.xaml</DependentUpon>
</Compile>
<Compile Include="Cases\Simple.xaml.cs">
<DependentUpon>Simple.xaml</DependentUpon>
</Compile>
<Compile Include="Cases\SimpleNames.xaml.cs">
<DependentUpon>SimpleNames.xaml</DependentUpon>
</Compile>
<Compile Include="Mocks\AvalonDock.cs" />
</ItemGroup>
<ItemGroup>
<Page Include="Cases\AttachedEvent.xaml" />
<Page Include="Cases\AvalonDockBrushes.xaml" />
<Page Include="Cases\AvalonDockCommon.xaml" />
<Page Include="Cases\EscapeSequence.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Cases\Issue1435.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Cases\Issue1546.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Cases\Issue1547.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Cases\Issue1688.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Cases\Issue2052.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Cases\Issue2097.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Cases\Issue2116.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Cases\Issue3318.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Cases\Issue775.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="Cases\MarkupExtension.xaml" />
<Page Include="Cases\MyControl.xaml" />
<Page Include="Cases\NamespacePrefix.xaml" />
<Page Include="Cases\ReadonlyProperty.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Cases\Resources.xaml" />
<Page Include="Cases\Simple.xaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Page>
<Page Include="Cases\SimpleDictionary.xaml" />
<Page Include="Cases\SimpleNames.xaml" />
<Page Include="Cases\SimplePropertyElement.xaml" />
<Page Include="Cases\Dictionary1.xaml" />
<Page Include="Cases\Issue445.xaml" />
</ItemGroup>
</Project>