Skip to content

Add .NET Core 3.0 support #52

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

Closed
VahidN opened this issue Aug 11, 2019 · 9 comments
Closed

Add .NET Core 3.0 support #52

VahidN opened this issue Aug 11, 2019 · 9 comments

Comments

@VahidN
Copy link

VahidN commented Aug 11, 2019

.NET Core 3.0 support can be added this way (tested and works fine)

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <Description>an AspNetCore TagHelper for pagination</Description>
    <Copyright>Source Tree Solutions</Copyright>
    <VersionPrefix>2.1.11</VersionPrefix>
    <AssemblyVersion>2.1.11</AssemblyVersion>
    <Authors>Joe Audette</Authors>
    <TargetFrameworks>netcoreapp3.0;netstandard2.0</TargetFrameworks>
    <PackageTags>cloudscribe;mvc;pagination;navigation;bootstrap</PackageTags>
    <PackageReleaseNotes></PackageReleaseNotes>
    <PackageIconUrl>https://raw.githubusercontent.com/joeaudette/cloudscribe.Web.Pagination/master/cloudscribe-icon-32.png</PackageIconUrl>
    <PackageProjectUrl>https://github.com/joeaudette/cloudscribe.Web.Pagination</PackageProjectUrl>
    <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
    <RepositoryUrl>https://github.com/cloudscribe/cloudscribe.Web.Pagination.git</RepositoryUrl>
    <RepositoryType>git</RepositoryType>
  </PropertyGroup>

  <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.3" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.3" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.TagHelpers" Version="2.1.3" />
    <PackageReference Include="System.Linq.Queryable" Version="4.3.0" />
  </ItemGroup>
  <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
    <DefineConstants>NETSTANDARD2_0</DefineConstants>
  </PropertyGroup>

  <ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">
    <FrameworkReference Include="Microsoft.AspNetCore.App" />
  </ItemGroup>
  <PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
    <DefineConstants>NETCOREAPP3_0</DefineConstants>
  </PropertyGroup>

  <ItemGroup>
    <ProjectReference Include="..\cloudscribe.Pagination.Models\cloudscribe.Pagination.Models.csproj" />
  </ItemGroup>
</Project>
@joeaudette
Copy link
Collaborator

No, that is not correct. This is a netstandard class library not an application so it will never be correct to target any version of netcoreapp.

As far as I know it should already be compatible to use our nuget package directly in an asp.net core 3.0 app because netstandard class libraries should be compatible. Only if there is some breaking change in asp.net core 3 then we may need to adapt to changes, but at the moment I have no reason to think it doesn't work already.

@joeaudette
Copy link
Collaborator

I just tested using this nuget in asp.net core 3.0 preview7 and it works fine for me.

@VahidN
Copy link
Author

VahidN commented Aug 11, 2019

@joeaudette
Copy link
Collaborator

joeaudette commented Aug 11, 2019

Neither of those links are relevant. cloudscribe.Web.Pagination already supports asp.net core 3 and .net core 3. There is no change needed.

@VahidN
Copy link
Author

VahidN commented Aug 11, 2019

You have a reference to Microsoft.AspNetCore.Mvc and Microsoft.AspNetCore.Mvc.Core and Microsoft.AspNetCore.Mvc.TagHelpers. These packages won't be produced anymore (you can't find their new versions on the nuget anymore). That's why you will need to adapt to the mentioned FrameworkReference.

@joeaudette
Copy link
Collaborator

no those references are only the minimum version and "The API for these packages will still be available"

those instructions are for what you do in your app not what you do in class library

As I mentioned I've already tested consuming our nuget package in asp.net core 3. I replicated the demo app in asp.net core 3 and it works fine.

@joeaudette
Copy link
Collaborator

the main app is what controls which framework you get, if it is higher version it overrides the class library minimum version dependency. There are no breaking changes that affect this library.

@joeaudette
Copy link
Collaborator

@joeaudette
Copy link
Collaborator

I've read more of those issues now, I'm not sure they have decided some of those issues fully yet.
Possibly when 3.0 comes out we will make a new version that targets netcoreapp3.0 and that one will only work with .NET Core 3.0. But for now using our current library seems fine and does work as it should.

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

No branches or pull requests

2 participants