From 66df1509c911209a9434ce32372d74e8e2bcf6b6 Mon Sep 17 00:00:00 2001 From: Hansjoerg Petriffer Date: Wed, 2 Sep 2026 08:28:34 +0200 Subject: [PATCH 1/2] Preserve inherited DefaultItemExcludes in XSharp.SDK.Props XSharp.SDK.Props assigned DefaultItemExcludes instead of appending to it, so any value the user had set in Directory.Build.props was silently discarded for .xsproj projects. Microsoft.NET.Sdk.DefaultItems.props always appends, so DefaultItemExcludes works as documented for C# and VB but not for X#. Prepend $(DefaultItemExcludes) to the assignment. The .NET SDK adds its own entries (BaseOutputPath, BaseIntermediateOutputPath, publish, **/*.user) after this file is imported, so the only values picked up by the prefix are the ones the user set explicitly. Co-Authored-By: Claude Opus 5 --- src/Compiler/src/Compiler/XSharpBuildTask/XSharp.SDK.Props | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Compiler/src/Compiler/XSharpBuildTask/XSharp.SDK.Props b/src/Compiler/src/Compiler/XSharpBuildTask/XSharp.SDK.Props index f9ca37c67b..5aa11f6cd7 100644 --- a/src/Compiler/src/Compiler/XSharpBuildTask/XSharp.SDK.Props +++ b/src/Compiler/src/Compiler/XSharpBuildTask/XSharp.SDK.Props @@ -17,7 +17,10 @@ Copyright (C) XSharp BV. All rights reserved. **\App.xaml **\*.vh;**\*.xh - $(VOBinaryFiles);$(AppXamlFiles);$(HeaderFiles);**/*.rc;**/*.resx;**/*.designer.prg;**/*.xaml.prg + + $(DefaultItemExcludes);$(VOBinaryFiles);$(AppXamlFiles);$(HeaderFiles);**/*.rc;**/*.resx;**/*.designer.prg;**/*.xaml.prg From 32017abb2e3a5b490cd00e117b35dfa1c41757ea Mon Sep 17 00:00:00 2001 From: Hansjoerg Petriffer Date: Wed, 2 Sep 2026 08:28:46 +0200 Subject: [PATCH 2/2] Exclude output directories from the default globs in XSharp.SDK.Props The item globs owned by the X# SDK (VOBinary, NativeResource, Compile for *.designer.prg and *.xaml.prg, EmbeddedResource, None, ApplicationDefinition) carried no Exclude attribute, so they reached into obj\ and bin\ as well. Stale generated files there are picked up as project items, which surfaces as XS0579/CS0579 "Duplicate attribute" whenever an intermediate directory from an earlier configuration is still on disk. Add Exclude="$(XSharpDefaultItemExcludes)" to those globs. The property is computed before the item types owned by X# are appended to DefaultItemExcludes, because the appended value would exclude exactly the files these globs are meant to collect. The output directories are listed explicitly: the .NET SDK adds them to DefaultItemExcludes only after this file is imported, which is too late for these globs. Empty-value guards keep a bare "/**" pattern from being formed. Co-Authored-By: Claude Opus 5 --- .../Compiler/XSharpBuildTask/XSharp.SDK.Props | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/Compiler/src/Compiler/XSharpBuildTask/XSharp.SDK.Props b/src/Compiler/src/Compiler/XSharpBuildTask/XSharp.SDK.Props index 5aa11f6cd7..de18bdbd9b 100644 --- a/src/Compiler/src/Compiler/XSharpBuildTask/XSharp.SDK.Props +++ b/src/Compiler/src/Compiler/XSharpBuildTask/XSharp.SDK.Props @@ -16,6 +16,19 @@ Copyright (C) XSharp BV. All rights reserved. **\*.xsfs;**\*.xsdbs;**\*.xsmnu;**\*.xsfrm;**\*.xsrep;**\*.xssql;**/*.vnfs;**/*.vndbs;**/*.vnmnu;**/*.vnfrm **\App.xaml **\*.vh;**\*.xh + + $(DefaultItemExcludes);$(DefaultExcludesInProjectFolder) + $(XSharpDefaultItemExcludes);$(BaseOutputPath)/** + $(XSharpDefaultItemExcludes);$(BaseIntermediateOutputPath)/** + $(XSharpDefaultItemExcludes);$(OutputPath)/** + $(XSharpDefaultItemExcludes);$(IntermediateOutputPath)/** + - + MSBuild:Compile - + $([System.Text.RegularExpressions.Regex]::Replace('%(Filename)%(Extension)', '\.[^.]+\%(Extension)$', '.prg')) %(ParentName) - + $([System.Text.RegularExpressions.Regex]::Replace('%(Filename)%(Extension)', '\.[^.]+\%(Extension)$', '.prg')) %(ParentName) - + $([System.Text.RegularExpressions.Regex]::Replace('%(Filename)%(Extension)', '.xaml.prg$', '.xaml', System.Text.RegularExpressions.RegexOptions.IgnoreCase)) %(ParentXamlName) - + $([System.Text.RegularExpressions.Regex]::Replace('%(Filename)%(Extension)', '.designer.prg$', '.prg', System.Text.RegularExpressions.RegexOptions.IgnoreCase)) $([System.Text.RegularExpressions.Regex]::Replace('%(Filename)%(Extension)', '.designer.prg$', '.resx', System.Text.RegularExpressions.RegexOptions.IgnoreCase)) @@ -51,12 +64,12 @@ Copyright (C) XSharp BV. All rights reserved. %(ParentResxName) %(ParentSettingsName) - + $([System.Text.RegularExpressions.Regex]::Replace('%(Filename)%(Extension)', '%(Extension)$', '.prg')) %(ParentName) - + $([System.Text.RegularExpressions.Regex]::Replace('%(Filename)%(Extension)', '%(Extension)$', '.prg')) %(ParentName)