-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
WinForms/WPF .NET Core 3 support for LibVLCSharp #71
Conversation
Probably better that way rather than rebasing 😉 |
@@ -1,4 +1,4 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use MSBuild.Sdk.Extras
here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about that. MSBuild.Sdk.Extras was great in setting up xamarin/WPF project with sdk-style csproj with VS2017. Now that VS 2019 and net core 3 are out, the Windows desktop sdk does that job for VS2019, and I guess dotnet CLI too.
I tried MSBuild.Sdk.Extras 2.x not too long ago, and I didn't manage to make it work with VS 2017 anyway. I'm in favor of migrating to VS 2019.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can keep support for VS2017 without effort, I say we should.
And referencing MSBuild.Sdk.Extras
here makes it follow the same convention than the WPF package (i.e. Microsoft.NET.Sdk.WindowsDesktop
is implicitly referenced AFAIK).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I fear about the "without effort" part. I'm not sure VS2017 is still officially supported by MSBuild.Sdk.Extras...
Thanks for the new PR. So, this works fine with both CLI and VS2019 (had to update to 16.3.3 though). It sadly doesn't build with VS2017 however.
Adding
to
Let's see if we can get this fixed, or we will drop VS2017 build support for these projects. |
@@ -2,16 +2,19 @@ | |||
<PropertyGroup> | |||
<Title>LibVLCSharp.WinForms.Sample</Title> | |||
<OutputType>WinExe</OutputType> | |||
<TargetFramework>net40</TargetFramework> | |||
<TargetFrameworks>net40;netcoreapp3.0</TargetFrameworks> | |||
<UseWindowsForms>true</UseWindowsForms> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove that line, it's already here.
<RootNamespace>LibVLCSharp.WinForms.Sample</RootNamespace> | ||
<UseWindowsForms>true</UseWindowsForms> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="VideoLAN.LibVLC.Windows" Version="3.0.8" /> | ||
</ItemGroup> | ||
<ItemGroup Condition="'$(TargetFramework)'=='net40'"> | ||
<Reference Include="System.Windows.Forms" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never tried netcoreapp 3.0 projects yet, but does UseWinForms add this reference only for netcoreapp or net framework applications as well?
I'd expect microsoft to ease multi-targetting as much as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, unnecessary.
@@ -31,7 +32,7 @@ LibVLC needs to be installed separately, see VideoLAN.LibVLC.* packages. | |||
<PackageReleaseNotes>https://code.videolan.org/videolan/LibVLCSharp/blob/master/NEWS</PackageReleaseNotes> | |||
<PackageTags>libvlc;vlc;videolan;native;c/c++;video;audio;player;media;mediaplayer;codec;ffmpeg;xamarin;graphics;ios;android;linux;windows;macos;cross-platform</PackageTags> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<ItemGroup Condition="'$(TargetFramework)'=='net461'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See if we can use the windows desktop sdk and clean up that file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep this whole ItemGroup can be removed.
@@ -50,6 +51,6 @@ LibVLC needs to be installed separately, see VideoLAN.LibVLC.* packages. | |||
</Page> | |||
<Page Remove="**\App.xaml" /> | |||
<ApplicationDefinition Include="**\App.xaml" /> | |||
<Reference Include="System.Xaml" /> | |||
<Reference Include="System.Xaml" Condition="'$(TargetFramework)'=='net461'"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be removed as well. Need to try a WPF netcore 3 sample to make sure
@@ -31,7 +32,7 @@ LibVLC needs to be installed separately, see VideoLAN.LibVLC.* packages. | |||
<ItemGroup> | |||
<ProjectReference Include="..\LibVLCSharp\LibVLCSharp.csproj" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ItemGroup Condition="'$(TargetFramework)'=='net40'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Reference can be removed as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry guys.
I did a quick conversion to support netcoreapp3.0.
I should have probably spent more time understanding your build process. I used VS Code / PS Core terminal to compile the project. There are a lot of prerequisite VS 2017/19 payloads which I didn't want to install (UWP, Xamarin, etc).
I was going to update the WPF sample app, but the project is still using old project format.
Let me know if you want me to update the PR and remove the conditional references.
I would love a nuget package targeting netcoreapp3.0 ASAP :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're on VS2017/VS4Mac 2017, but we need to make te migration anyway.
I guess we should make the migration all at once and see if any of the project has incompatibilities.
I might be able to give that a try in the weekend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened dashkan#2 , but I just noticed Martin already did it...
@dashkan 3.2.4 on nuget contains netcore 3 WPF/WinForms support. Thanks for your help! |
Description of Change
I apologize for not updating the existing PR. I had so many problems trying to rebase. I no longer have issues building w/ MSBuild.Sdk.Extras 2.0..54.
You can run the winforms sample by running
dotnet run -f netcoreapp3.0
from sample directory.Add support for .net core 3.0 winforms and wpf. Update winforms sample to support netcoreapp3.0.
Issues Resolved
API Changes
None
Platforms Affected
New platform added
Behavioral/Visual Changes
None
Before/After Screenshots
Not applicable
Testing Procedure
PR Checklist