Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Add support for .NET Standard #308

Merged
merged 6 commits into from
Sep 21, 2017
Merged

Add support for .NET Standard #308

merged 6 commits into from
Sep 21, 2017

Conversation

qmfrederik
Copy link
Contributor

@qmfrederik qmfrederik commented Sep 20, 2017

This PR adds support for .NET Standard to Vlc.DotNet.

The .NET Core SDK and Visual Studio 2017 allow you to:

  • Target multiple versions of the .NET Framework from a single .csproj file.
  • Build a NuGet package from a .csproj file

The .csproj files for the class libraries/NuGet packages have been updated to use this new project format. As a result, you'll need Visual Studio 2017, Visual Studio Code or the .NET Core CLI and a command-line editor to build the project.

The AppVeyor project has been updated accordingly.

@jeremyVignelles
Copy link
Collaborator

Hey thanks for your contribution! It's something we were thinking of and that we would have implemented in the next few weeks. I will have a look at it.

You are welcome to join the gitter discussion if you like :)

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net20;net35;net40;net45;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net20;net35;net40;net45;netstandard2.0;netstandard1.3</TargetFrameworks>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to keep both netstandard2.0 and netstandard1.3 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to do so; some code is missing in netstandard1.3 (like Encoding.Default) which is present in netstandard2.0. So the netstandard1.3 & 2.0 builds are not exactly the same.

Which brings me to another question - why do target .NET 2.0, 3.5, 4.0 and 4.5?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backward compatibility I guess. Not sure if the original developer knows himself if this is still needed...

appveyor.yml Outdated
- ps: nuget pack C:\projects\vlc-dotnet-master\nuget\Vlc.DotNet.Wpf.nuspec -version $env:APPVEYOR_BUILD_VERSION
- msbuild /t:Restore /Verbosity:Minimal "src\Vlc.DotNet.sln"
- msbuild /t:Build /p:Configuration=Release "src\Vlc.DotNet.sln"
- msbuild /t:Pack /p:Configuration=Release "src\Vlc.DotNet.Core.Interops\Vlc.DotNet.Core.Interops.csproj"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where has the version gone?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can provide a VersionSuffix and a VersionPrefix as MSBuild variables. The .NET Core SDK then uses that for assembly and NuGet package version numbers. I've updated the PR to do that.

For the time being, I disabled automatic assembly version information generation because it conflicts with some of the AssemblyInfo files you already have. It's something you may want to consider enabling later.

appveyor.yml Outdated
- ps: nuget pack C:\projects\vlc-dotnet-master\nuget\Vlc.DotNet.Forms.nuspec -version $env:APPVEYOR_BUILD_VERSION
- ps: nuget pack C:\projects\vlc-dotnet-master\nuget\Vlc.DotNet.Wpf.nuspec -version $env:APPVEYOR_BUILD_VERSION
- msbuild /t:Restore /Verbosity:Minimal "src\Vlc.DotNet.sln"
- msbuild /t:Build /p:Configuration=Release "src\Vlc.DotNet.sln"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't there the /logger option?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it back. Not sure if it's really needed these days, though.

@jeremyVignelles
Copy link
Collaborator

Can you rebase? I've fixed the weird UTF-8 conversion as per your private comments on gitter

- For class libraries, use a single .NET Core project which multi-targets net20, net35, net40, net45 and netstandard2.0
- Update the references in the sample projects (but keep a sample project per target framework)
- Update the solution file
Build and package using msbuild, as a workdaround for dotnet/msbuild#1333
@qmfrederik
Copy link
Contributor Author

Looks better. The only difference between netstandard1.3 and netstandard2.0 are some CAS attributes.

@jeremyVignelles jeremyVignelles merged commit 361267f into ZeBobo5:develop Sep 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants