Skip to content

Fix compilation of 0.10.2 under msbuild.exe due to inaccessible CloseTabButtonCommandProperty member. - #404

Closed
mjr4077au wants to merge 1 commit into
iNKORE-NET:mainfrom
mjr4077au:fix/0.10.2_msbuild_compilation
Closed

mjr4077au wants to merge 1 commit into
iNKORE-NET:mainfrom
mjr4077au:fix/0.10.2_msbuild_compilation

Conversation

@mjr4077au

Copy link
Copy Markdown
Restore complete (3.5s)
  iNKORE.UI.WPF net472 succeeded (7.6s) → C:\Repos\PSAppDeployToolkit\lib\iNKORE.UI.WPF\source\iNKORE.UI.WPF\bin\Release\net472\iNKORE.UI.WPF.dll
  iNKORE.UI.WPF net8.0-windows succeeded (9.0s) → C:\Repos\PSAppDeployToolkit\lib\iNKORE.UI.WPF\source\iNKORE.UI.WPF\bin\Release\net8.0-windows\iNKORE.UI.WPF.dll
  iNKORE.UI.WPF.Modern net472 failed with 1 error(s) (10.9s)
    C:\Repos\PSAppDeployToolkit\lib\iNKORE.UI.WPF.Modern\source\iNKORE.UI.WPF.Modern\Themes\Controls\TabControl.xaml(285,33): error MC3019: Cannot reference the static member 'CloseTabButtonCommandProperty' on the type 'TabItemHelper' as it is not accessible.
  iNKORE.UI.WPF.Modern net8.0-windows10.0.18362.0 failed with 1 error(s) (9.7s)
    C:\Repos\PSAppDeployToolkit\lib\iNKORE.UI.WPF.Modern\source\iNKORE.UI.WPF.Modern\Themes\Controls\TabControl.xaml(285,33): error MC3019: Cannot reference the static member 'CloseTabButtonCommandProperty' on the type 'TabItemHelper' as it is not accessible.

…eTabButtonCommandProperty` member.

Restore complete (3.5s)
  iNKORE.UI.WPF net472 succeeded (7.6s) → C:\Repos\PSAppDeployToolkit\lib\iNKORE.UI.WPF\source\iNKORE.UI.WPF\bin\Release\net472\iNKORE.UI.WPF.dll
  iNKORE.UI.WPF net8.0-windows succeeded (9.0s) → C:\Repos\PSAppDeployToolkit\lib\iNKORE.UI.WPF\source\iNKORE.UI.WPF\bin\Release\net8.0-windows\iNKORE.UI.WPF.dll
  iNKORE.UI.WPF.Modern net472 failed with 1 error(s) (10.9s)
    C:\Repos\PSAppDeployToolkit\lib\iNKORE.UI.WPF.Modern\source\iNKORE.UI.WPF.Modern\Themes\Controls\TabControl.xaml(285,33): error MC3019: Cannot reference the static member 'CloseTabButtonCommandProperty' on the type 'TabItemHelper' as it is not accessible.
  iNKORE.UI.WPF.Modern net8.0-windows10.0.18362.0 failed with 1 error(s) (9.7s)
    C:\Repos\PSAppDeployToolkit\lib\iNKORE.UI.WPF.Modern\source\iNKORE.UI.WPF.Modern\Themes\Controls\TabControl.xaml(285,33): error MC3019: Cannot reference the static member 'CloseTabButtonCommandProperty' on the type 'TabItemHelper' as it is not accessible.
@NotYoojun

NotYoojun commented Nov 27, 2025

Copy link
Copy Markdown
Member

CloseTabButtonCommandProperty is supposed to be internal, and you are not supposed to use it here.

In the latest version, how tab close buttons work has changed. Please see the migration guide: #400 (comment)

As for the compilation issue, I'm not sure why the error was here, but everything works both on my side and GH actions.

@mjr4077au

mjr4077au commented Nov 27, 2025

Copy link
Copy Markdown
Author

The error is in your own iNKORE.UI.WPF.Modern\Themes\Controls\TabControl.xaml file though, it's not originating from my project. Maybe validate the file and see that it's been migrated properly?

@NotYoojun

Copy link
Copy Markdown
Member

I'm not sure why the error was here, but everything works both on my side and GH actions.

I'm not sure why the error was here, but everything works both on my side and GH actions.

@mjr4077au

Copy link
Copy Markdown
Author

What happens if you build the project using Visual Studio?

@NotYoojun

Copy link
Copy Markdown
Member

What happens if you build the project using Visual Studio?

image image

========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

@mjr4077au

Copy link
Copy Markdown
Author

Ok, I too can build it in Visual Studio; it's just that my project's build system can't build it. I'll close this one for now while I investigate but I don't believe there's an upstream issue here. Apologies for all the noise.

@mjr4077au mjr4077au closed this Nov 27, 2025
@mjr4077au

Copy link
Copy Markdown
Author

@NotYoojun if you did want to try dotnet.exe msbuild "C:\Repos\UI.WPF.Modern\iNKORE.UI.WPF.Modern.sln" -target:"Rebuild" -restore -p:configuration=Debug -p:platform="Any CPU" -nodeReuse:false -m and see what you receive, I would be appreciative though as I can replicate it every time.

@NotYoojun

Copy link
Copy Markdown
Member

Ok, I too can build it in Visual Studio; it's just that my project's build system can't build it. I'll close this one for now while I investigate but I don't believe there's an upstream issue here. Apologies for all the noise.

It's okay la. feel free to reach us whenever you have any new findings!

@NotYoojun

Copy link
Copy Markdown
Member

@NotYoojun if you did want to try dotnet.exe msbuild "C:\Repos\UI.WPF.Modern\iNKORE.UI.WPF.Modern.sln" -target:"Rebuild" -restore -p:configuration=Debug -p:platform="Any CPU" -nodeReuse:false -m and see what you receive, I would be appreciative though as I can replicate it every time.

Got it, I'll try later

@NotYoojun

Copy link
Copy Markdown
Member

Aha, got it! The issue is not with the code itself, but with the difference between dotnet msbuild and msbuild.exe.
When using dotnet msbuild, the process would fail like you mentioned, but if we change it to msbuild.exe:

msbuild.exe "E:\Yoojun Products\iNKORE.OpenSource\UI.WPF.Modern\iNKORE.UI.WPF.Modern.sln" -target:"Rebuild" -restore -p:configuration=Debug -p:platform="Any CPU" -nodeReuse:false -m

Everything works:

image

@mjr4077au

Copy link
Copy Markdown
Author

The reason it's using dotnet msbuild is that our target is -target:"Rebuild,VSTest", allowing us to run our unit tests as part of the build. This isn't supported with msbuild.exe directly. I realise this is more my issue rather than yours, but its an explanation all the same.

I'm still curious as to why there's an inaccessibility issue that varies purely based on compilation though.

@NotYoojun

Copy link
Copy Markdown
Member

Author

Me too, wondering how the compiler matters to this...Very weird.

@mjr4077au

Copy link
Copy Markdown
Author

For now, I'm just using msbuild.exe directly and then doing dotnet test --no-build afterwards. It's not as good though and a full recompile seems to produce differing DLLs compared to dotnet msbuild. I'll keep playing on my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants