brucedog / U2F_Core

U2F library for .NET Core
https://bfoster.me/U2FDemo/DemoHome
MIT License
37 stars 11 forks source link

NuGet Package Broken #4

Closed kspearrin closed 7 years ago

kspearrin commented 7 years ago

NuGet package does not seem to work.

  1. Create a new, blank ASP.NET Core website project. (my test was with a Full Framework project).
  2. Launch website. Observe it works just fine.
  3. Run Install-Package U2F.Core
  4. Launch website. Observe error on startup:

System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.' Inner Exception: FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

When adding the package from NuGet it shows that there are no dependencies, which definitely isn't right either. https://www.nuget.org/packages/U2F.Core

brucedog commented 7 years ago

Kspearrin,

Did you get the following error message after you ran the "Install-Package U2F.Core"? Install-Package : Package U2F.Core 1.0.1 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package U2F.Core 1.0.1 supports: net (.NETFramework,Version=v0.0)

Thanks, Bryce

kspearrin commented 7 years ago
PM> Install-Package U2F.Core
  GET https://api.nuget.org/v3/registration2-gz/u2f.core/index.json
  OK https://api.nuget.org/v3/registration2-gz/u2f.core/index.json 55ms
Restoring packages for C:\Users\kyles\Documents\Visual Studio 2017\Projects\WebApplication1\WebApplication1\WebApplication1.csproj...
Installing NuGet package U2F.Core 1.0.1.
Committing restore...
Writing lock file to disk. Path: C:\Users\kyles\Documents\Visual Studio 2017\Projects\WebApplication1\WebApplication1\obj\project.assets.json
Restore completed in 351.07 ms for C:\Users\kyles\Documents\Visual Studio 2017\Projects\WebApplication1\WebApplication1\WebApplication1.csproj.
Successfully installed 'U2F.Core 1.0.1' to WebApplication1
Executing nuget actions took 702.92 ms
Time Elapsed: 00:00:01.5727483
PM> 
brucedog commented 7 years ago

Kspearrin, Just updated the U2F.Core nuget package to 1.0.2. I was able to install the package and run the asp.net core website. Let me know if you are still having issues.

Thanks, Bryce

kspearrin commented 7 years ago

Ok, getting more information about the problem now. It appears that it is having issues with just full framework ASP.NET Core websites:

PM> Install-Package U2F.Core
  GET https://api.nuget.org/v3/registration2-gz/u2f.core/index.json
  OK https://api.nuget.org/v3/registration2-gz/u2f.core/index.json 50ms
Restoring packages for C:\Users\kyles\Documents\Visual Studio 2017\Projects\WebApplication1\WebApplication1\WebApplication1.csproj...
Install-Package : Package U2F.Core 1.0.2 is not compatible with net452 (.NETFramework,Version=v4.5.2). Package U2F.Core 1.0.2 supports: netstandard1.6 (.NETStandard,Version=v1.6)
At line:1 char:1
+ Install-Package U2F.Core
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Install-Package : One or more packages are incompatible with .NETFramework,Version=v4.5.2.
At line:1 char:1
+ Install-Package U2F.Core
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Install-Package : Package U2F.Core 1.0.2 is not compatible with net452 (.NETFramework,Version=v4.5.2) / win7-x86. Package U2F.Core 1.0.2 supports: netstandard1.6 (.NETStandard,Version=v1.6)
At line:1 char:1
+ Install-Package U2F.Core
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Install-Package : One or more packages are incompatible with .NETFramework,Version=v4.5.2 (win7-x86).
At line:1 char:1
+ Install-Package U2F.Core
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Install-Package : Package restore failed. Rolling back package changes for 'WebApplication1'.
At line:1 char:1
+ Install-Package U2F.Core
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Time Elapsed: 00:00:00.8631471
PM> 

TargetFrameworks in the csproj should be updated to also include net45

<TargetFramework>netstandard1.6;net45</TargetFramework>
brucedog commented 7 years ago

Nuget package has been updated to include .NET 4.5 and .NET 4.62

kspearrin commented 7 years ago

Thanks. Working well now!