Skip to content
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

WinUI: Changed the way to detect a WinUI application #354

Closed
wants to merge 1 commit into from

Conversation

optsing
Copy link

@optsing optsing commented Jul 4, 2024

Description of Change

Prior to this change, LibVLCSharp detected WinUI usage by TargetFramework.StartsWith('net6.0-windows10'), which was not always correct.
Microsoft recommends specifying <UseWinUI>true</UseWinUI> for WinUI applications, which seems to be a more correct way to detect a WinUI application.

Issues Resolved

None

API Changes

None

Platforms Affected

  • Windows
  • WinUI

Behavioral/Visual Changes

None

Before/After Screenshots

Not applicable

Testing Procedure

PR Checklist

  • Rebased on top of the target branch at time of PR
  • Changes adhere to coding standard

@mfkl
Copy link
Member

mfkl commented Jul 4, 2024

CI complains

2024-07-04T17:27:45.9959683Z   D:\a\1\s\samples\LibVLCSharp.WinUI.Sample\MainWindow.xaml.cs(1,19): error CS0234: The type or namespace name 'Platforms' does not exist in the namespace 'LibVLCSharp' (are you missing an assembly reference?) [D:\a\1\s\samples\LibVLCSharp.WinUI.Sample\LibVLCSharp.WinUI.Sample.csproj]
2024-07-04T17:27:45.9960821Z   D:\a\1\s\samples\LibVLCSharp.WinUI.Sample\MainWindow.xaml.cs(36,59): error CS0246: The type or namespace name 'InitializedEventArgs' could not be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\samples\LibVLCSharp.WinUI.Sample\LibVLCSharp.WinUI.Sample.csproj]
2024-07-04T17:27:45.9962065Z   D:\a\1\s\samples\LibVLCSharp.WinUI.Sample\obj\x64\Release\net6.0-windows10.0.19041.0\MainWindow.g.i.cs(22,37): error CS0234: The type or namespace name 'Platforms' does not exist in the namespace 'LibVLCSharp' (are you missing an assembly reference?) [D:\a\1\s\samples\LibVLCSharp.WinUI.Sample\LibVLCSharp.WinUI.Sample.csproj]

@mfkl
Copy link
Member

mfkl commented Jul 4, 2024

I could be wrong, but I think you're confusing the csproj setup between an app and a library.

UseWinUI is currently set in the app sample, not the library project. So when LibVLCSharp is built, UseWinUI will always be false.

Additionally, I believe that targeting net6.0-win10 does not necessarily mean you are building a WinUI-based app. You might be building a CLI app that does not depend on WinUI but needs to access Win10 APIs.

@mfkl
Copy link
Member

mfkl commented Jul 4, 2024

Could you please share a minimal sample (ideally a sample from your fork from this repo) that reproduces your issue?

@mfkl
Copy link
Member

mfkl commented Aug 26, 2024

Closing for inactivity. Feel free to re-open with updates.

@mfkl mfkl closed this Aug 26, 2024
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