braintree / braintree_dotnet

Braintree .NET library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
136 stars 73 forks source link

Support for .NET Core 1.1 runtime #45

Closed bangonkali closed 7 years ago

bangonkali commented 7 years ago

We tried to transition to .NET Core 1.1 runtime image

We keep getting issues with the:

/usr/share/dotnet/sdk/1.0.0-preview4-004233/NuGet.targets(70,5): error : Package Microsoft.AspNet.WebUtilities 1.0.0-rc1-final is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.AspNet.WebUtilities 1.0.0-rc1-final supports: [/var/www/wkd-dotnet/src/Wkd/Wkd.csproj]
/usr/share/dotnet/sdk/1.0.0-preview4-004233/NuGet.targets(70,5): error :   - dotnet5.4 (.NETPlatform,Version=v5.4) [/var/www/wkd-dotnet/src/Wkd/Wkd.csproj]
/usr/share/dotnet/sdk/1.0.0-preview4-004233/NuGet.targets(70,5): error :   - net451 (.NETFramework,Version=v4.5.1) [/var/www/wkd-dotnet/src/Wkd/Wkd.csproj]
/usr/share/dotnet/sdk/1.0.0-preview4-004233/NuGet.targets(70,5): error : One or more packages are incompatible with .NETCoreApp,Version=v1.1. [/var/www/wkd-dotnet/src/Wkd/Wkd.csproj]

It seems your dependency of Microsoft.AspNet.WebUtilities 1.0.0-rc1-final is causing the issue. image

Do you have plans of supporting 1.1 out of the box?

So far the dotnet restore fails on our project but strangely it still builds successfully.

paulers commented 7 years ago

1.1 has been out for a while. Would be great to get this sorted... can't use Braintree SDK at all in any of my upcoming projects.

funkyhippy commented 7 years ago

You can get around this by targeting dotnet451 as well in the project file:

-In vs2017 RC unload then edit the project file, -look for the following line:

<PropertyGroup>
    <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81</PackageTargetFallback>
  </PropertyGroup>

-add ;net451 to the value so you have:

<PropertyGroup>
    <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;net451</PackageTargetFallback>
  </PropertyGroup>

you should now be able to add the Braintree NuGet package.

(see: http://www.natemcmaster.com/blog/2017/01/19/project-json-to-csproj/ for the new csproj format used in 2017 RC)

bangonkali commented 7 years ago

@funkyhippy for some reason this solution works. Do you think adding net45 will have any effect to those who deploy server on linux?

lkorth commented 7 years ago

Microsoft.AspNet.WebUtilities 1.0.0-rc1-final was removed as a dependency in 3.7.0.

Please try using 3.7.0 and let us know if this resolves your issue.

lkorth commented 7 years ago

Closing this issue. Please let us know if 3.7.0 or newer does not solve your issue.