Skip to content
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

Can't install on .NET 4.6.1 - System.Runtime not found in the GAC #91

Closed
reduckted opened this issue Feb 1, 2017 · 28 comments · Fixed by #185
Closed

Can't install on .NET 4.6.1 - System.Runtime not found in the GAC #91

reduckted opened this issue Feb 1, 2017 · 28 comments · Fixed by #185
Assignees
Labels
Milestone

Comments

@reduckted
Copy link

I can't install NLog.Extensions.Logging 1.0.0-rtm-beta1 in a .NET 4.6.1 console application. It fails with this error:

Failed to add reference. The package 'NLog.Extensions.Logging' tried to add a framework reference to 'System.Runtime' which was not found in the GAC. This is possibly a bug in the package. Please contact the package owners for assistance.

Sounds similar to #52.

Steps to reproduce:

  1. Create a new C# console application for .NET 4.6.1
  2. Run Install-Package NLog.Extensions.Logging -Pre

Here's the entire install log:

PM> Install-Package NLog.Extensions.Logging -Pre

Attempting to gather dependency information for package 'NLog.Extensions.Logging.1.0.0-rtm-beta1' with respect to project 'ConsoleApplication4', targeting '.NETFramework,Version=v4.6.1'
Gathering dependency information took 23.17 sec
Attempting to resolve dependencies for package 'NLog.Extensions.Logging.1.0.0-rtm-beta1' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'NLog.Extensions.Logging.1.0.0-rtm-beta1'
Resolved actions to install package 'NLog.Extensions.Logging.1.0.0-rtm-beta1'
Retrieving package 'NLog.Extensions.Logging 1.0.0-rtm-beta1' from 'nuget.org'.
Retrieving package 'Microsoft.Extensions.Logging.Abstractions 1.0.0' from 'nuget.org'.
Retrieving package 'System.Resources.ResourceManager 4.0.1' from 'nuget.org'.
Retrieving package 'System.Collections 4.0.11' from 'nuget.org'.
Retrieving package 'System.Diagnostics.Debug 4.0.11' from 'nuget.org'.
Retrieving package 'System.Globalization 4.0.11' from 'nuget.org'.
Retrieving package 'System.Collections.Concurrent 4.0.12' from 'nuget.org'.
Retrieving package 'System.Linq 4.1.0' from 'nuget.org'.
Retrieving package 'System.Reflection 4.1.0' from 'nuget.org'.
Retrieving package 'System.Runtime.Extensions 4.1.0' from 'nuget.org'.
Retrieving package 'System.Runtime.InteropServices 4.1.0' from 'nuget.org'.
Retrieving package 'NLog 4.4.1' from 'nuget.org'.
Adding package 'NLog.4.4.1' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'NLog.4.4.1' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'NLog.4.4.1' to 'packages.config'
Successfully installed 'NLog 4.4.1' to ConsoleApplication4
Adding package 'System.Collections.4.0.11' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Collections.4.0.11' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Collections.4.0.11' to 'packages.config'
Successfully installed 'System.Collections 4.0.11' to ConsoleApplication4
Adding package 'System.Collections.Concurrent.4.0.12' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Collections.Concurrent.4.0.12' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Collections.Concurrent.4.0.12' to 'packages.config'
Successfully installed 'System.Collections.Concurrent 4.0.12' to ConsoleApplication4
Adding package 'System.Diagnostics.Debug.4.0.11' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Diagnostics.Debug.4.0.11' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Diagnostics.Debug.4.0.11' to 'packages.config'
Successfully installed 'System.Diagnostics.Debug 4.0.11' to ConsoleApplication4
Adding package 'System.Globalization.4.0.11' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Globalization.4.0.11' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Globalization.4.0.11' to 'packages.config'
Successfully installed 'System.Globalization 4.0.11' to ConsoleApplication4
Adding package 'System.Linq.4.1.0' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Linq.4.1.0' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Linq.4.1.0' to 'packages.config'
Successfully installed 'System.Linq 4.1.0' to ConsoleApplication4
Adding package 'System.Reflection.4.1.0' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Reflection.4.1.0' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Reflection.4.1.0' to 'packages.config'
Successfully installed 'System.Reflection 4.1.0' to ConsoleApplication4
Adding package 'System.Resources.ResourceManager.4.0.1' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Resources.ResourceManager.4.0.1' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Resources.ResourceManager.4.0.1' to 'packages.config'
Successfully installed 'System.Resources.ResourceManager 4.0.1' to ConsoleApplication4
Adding package 'System.Runtime.Extensions.4.1.0' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Runtime.Extensions.4.1.0' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Runtime.Extensions.4.1.0' to 'packages.config'
Successfully installed 'System.Runtime.Extensions 4.1.0' to ConsoleApplication4
Adding package 'System.Runtime.InteropServices.4.1.0' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Runtime.InteropServices.4.1.0' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'System.Runtime.InteropServices.4.1.0' to 'packages.config'
Successfully installed 'System.Runtime.InteropServices 4.1.0' to ConsoleApplication4
Adding package 'Microsoft.Extensions.Logging.Abstractions.1.0.0' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'Microsoft.Extensions.Logging.Abstractions.1.0.0' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'Microsoft.Extensions.Logging.Abstractions.1.0.0' to 'packages.config'
Successfully installed 'Microsoft.Extensions.Logging.Abstractions 1.0.0' to ConsoleApplication4
Adding package 'NLog.Extensions.Logging.1.0.0-rtm-beta1' to folder 'C:\Code\ConsoleApplication4\packages'
Added package 'NLog.Extensions.Logging.1.0.0-rtm-beta1' to folder 'C:\Code\ConsoleApplication4\packages'
Install failed. Rolling back...
Package 'NLog.Extensions.Logging.1.0.0-rtm-beta1 : Microsoft.Extensions.Logging.Abstractions [1.0.0, ), NLog [4.4.1, )' does not exist in project 'ConsoleApplication4'
Removed package 'Microsoft.Extensions.Logging.Abstractions.1.0.0 : System.Collections [4.0.11, ), System.Collections.Concurrent [4.0.12, ), System.Diagnostics.Debug [4.0.11, ), System.Globalization [4.0.11, ), System.Linq [4.1.0, ), System.Reflection [4.1.0, ), System.Resources.ResourceManager [4.0.1, ), System.Runtime.Extensions [4.1.0, ), System.Runtime.InteropServices [4.1.0, )' from 'packages.config'
Removed package 'System.Runtime.InteropServices.4.1.0' from 'packages.config'
Removed package 'System.Runtime.Extensions.4.1.0' from 'packages.config'
Removed package 'System.Resources.ResourceManager.4.0.1' from 'packages.config'
Removed package 'System.Reflection.4.1.0' from 'packages.config'
Removed package 'System.Linq.4.1.0' from 'packages.config'
Removed package 'System.Globalization.4.0.11' from 'packages.config'
Removed package 'System.Diagnostics.Debug.4.0.11' from 'packages.config'
Removed package 'System.Collections.Concurrent.4.0.12' from 'packages.config'
Removed package 'System.Collections.4.0.11' from 'packages.config'
Removed package 'NLog.4.4.1' from 'packages.config'
Removing package 'NLog.Extensions.Logging.1.0.0-rtm-beta1 : Microsoft.Extensions.Logging.Abstractions [1.0.0, ), NLog [4.4.1, )' from folder 'C:\Code\ConsoleApplication4\packages'
Removed package 'NLog.Extensions.Logging.1.0.0-rtm-beta1 : Microsoft.Extensions.Logging.Abstractions [1.0.0, ), NLog [4.4.1, )' from folder 'C:\Code\ConsoleApplication4\packages'
Removing package 'Microsoft.Extensions.Logging.Abstractions.1.0.0 : System.Collections [4.0.11, ), System.Collections.Concurrent [4.0.12, ), System.Diagnostics.Debug [4.0.11, ), System.Globalization [4.0.11, ), System.Linq [4.1.0, ), System.Reflection [4.1.0, ), System.Resources.ResourceManager [4.0.1, ), System.Runtime.Extensions [4.1.0, ), System.Runtime.InteropServices [4.1.0, )' from folder 'C:\Code\ConsoleApplication4\packages'
Removed package 'Microsoft.Extensions.Logging.Abstractions.1.0.0 : System.Collections [4.0.11, ), System.Collections.Concurrent [4.0.12, ), System.Diagnostics.Debug [4.0.11, ), System.Globalization [4.0.11, ), System.Linq [4.1.0, ), System.Reflection [4.1.0, ), System.Resources.ResourceManager [4.0.1, ), System.Runtime.Extensions [4.1.0, ), System.Runtime.InteropServices [4.1.0, )' from folder 'C:\Code\ConsoleApplication4\packages'
Removing package 'System.Runtime.InteropServices.4.1.0' from folder 'C:\Code\ConsoleApplication4\packages'
Removed package 'System.Runtime.InteropServices.4.1.0' from folder 'C:\Code\ConsoleApplication4\packages'
Removing package 'System.Runtime.Extensions.4.1.0' from folder 'C:\Code\ConsoleApplication4\packages'
Removed package 'System.Runtime.Extensions.4.1.0' from folder 'C:\Code\ConsoleApplication4\packages'
Removing package 'System.Resources.ResourceManager.4.0.1' from folder 'C:\Code\ConsoleApplication4\packages'
Removed package 'System.Resources.ResourceManager.4.0.1' from folder 'C:\Code\ConsoleApplication4\packages'
Removing package 'System.Reflection.4.1.0' from folder 'C:\Code\ConsoleApplication4\packages'
Removed package 'System.Reflection.4.1.0' from folder 'C:\Code\ConsoleApplication4\packages'
Removing package 'System.Linq.4.1.0' from folder 'C:\Code\ConsoleApplication4\packages'
Removed package 'System.Linq.4.1.0' from folder 'C:\Code\ConsoleApplication4\packages'
Removing package 'System.Globalization.4.0.11' from folder 'C:\Code\ConsoleApplication4\packages'
Removed package 'System.Globalization.4.0.11' from folder 'C:\Code\ConsoleApplication4\packages'
Removing package 'System.Diagnostics.Debug.4.0.11' from folder 'C:\Code\ConsoleApplication4\packages'
Removed package 'System.Diagnostics.Debug.4.0.11' from folder 'C:\Code\ConsoleApplication4\packages'
Removing package 'System.Collections.Concurrent.4.0.12' from folder 'C:\Code\ConsoleApplication4\packages'
Removed package 'System.Collections.Concurrent.4.0.12' from folder 'C:\Code\ConsoleApplication4\packages'
Removing package 'System.Collections.4.0.11' from folder 'C:\Code\ConsoleApplication4\packages'
Removed package 'System.Collections.4.0.11' from folder 'C:\Code\ConsoleApplication4\packages'
Removing package 'NLog.4.4.1' from folder 'C:\Code\ConsoleApplication4\packages'
Removed package 'NLog.4.4.1' from folder 'C:\Code\ConsoleApplication4\packages'
Executing nuget actions took 7.14 sec
Install-Package : Failed to add reference. The package 'NLog.Extensions.Logging' tried to add a framework 
reference to 'System.Runtime' which was not found in the GAC. This is possibly a bug in the package. Please 
contact the package owners for assistance.
  Reference unavailable.
At line:1 char:1
+ install-package NLog.Extensions.Logging -Pre
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPac 
   kageCommand
 
Time Elapsed: 00:00:32.0859737
@304NotModified 304NotModified self-assigned this Feb 11, 2017
@304NotModified
Copy link
Member

Could you try adding the following package?

https://www.nuget.org/packages/System.Runtime/

@reduckted
Copy link
Author

Just tried installing System.Runtime first, then installing NLog.Extensions.Logging but ended up with the same result.

@jamesbperry
Copy link

I'm in the same situation, with an existing app (.NET 4.6.1, NLog) that needs to couple to a library that uses Microsoft.Extensions.Logging. Is there any sort of workaround until the System.Runtime dependency issue is resolved?

@reduckted
Copy link
Author

@jamesbperry The last alpha version 1.0.0-rtm-alpha5 installs without any issues, but I'm not sure if there were any significant changes between that version and the latest beta2.

@304NotModified
Copy link
Member

304NotModified commented Feb 16, 2017

so 1.0.0-rtm-alpha5 works and beta1 and beta2 not?

since the beta we removed the ASP.NET dependency

@jamesbperry
Copy link

@reduckted Thanks. I got cold feet about even trying 1.0.0-rtm-alpha5, given its dependency on Microsoft.AspNetCore.Hosting (and thus a zillion other packages). But - in the interim - that's better than nothing.

@304NotModified
Copy link
Member

could you check if you have these assemblies in your GAC and which version?

        "System.Xml": "4.0.0.0",
        "System.Runtime": "4.0.10.0",
        "System.Xml.Serialization": "4.0.0.0"

@jamesbperry
Copy link

The Global Assembly Cache contains the following assemblies:
System.Runtime, Version=4.0.0.0, ...
System.Xml, Version=2.0.0.0, ...
System.Xml, Version=4.0.0.0, ...
System.Xml.Serialization, Version=4.0.0.0 ...

@reduckted
Copy link
Author

@304NotModified My GAC has the same versions as @jamesbperry.

@304NotModified
Copy link
Member

I can finally reproduce the problem :)

Unfortunately dunno what the cause of this problem is. Testing now

@304NotModified
Copy link
Member

304NotModified commented Feb 16, 2017

If I have this in our library, I can install it !

"dependencies": {
  "Microsoft.Extensions.Logging.Abstractions": "1.1.0"
}, "frameworks": {
  "net461": {
    "dependencies": {

      "System.Xml.ReaderWriter": "4.3.0",
      "System.Runtime": "4.0.10.0",
      "NLog": "4.4.2"
    }
  },
  "netstandard1.3": {
    "dependencies": {
      "NLog": "5.0.0-beta05",
      "System.AppContext": "4.3.0"
    },
    "buildOptions": { "define": [ "NETCORE" ] }
  }
}

But no .NET 4.5.1.

So then I try this:

 "dependencies": {
    "Microsoft.Extensions.Logging.Abstractions": "1.1.0"
  },
  "frameworks": {
    "net451": {
      "frameworkAssemblies": {
        "System.Xml": "",
        "System.Runtime": "",
        "System.Xml.Serialization": ""


      },
      "dependencies": {
        "NLog": "4.4.2"
      }
    },
    "net461": {
      "dependencies": {

        "System.Xml.ReaderWriter": "4.3.0",
        "System.Runtime": "4.0.10.0",
        "NLog": "4.4.2"
      }
    },
    "netstandard1.3": {
      "dependencies": {
        "NLog": "5.0.0-beta05",
        "System.AppContext": "4.3.0"
      },
      "buildOptions": { "define": [ "NETCORE" ] }
    }
  }

and then the error

Install-Package : Failed to add reference. The package 'NLog.Extensions.Logging' tried to add a framework reference to 'System.Runtime' which was not found in the GAC. This is possibly a bug in the package. Please contact the pa
ckage owners for assistance.
At line:1 char:1
+ Install-Package NLog.Extensions.Logging -Version 1.0.0-rtm-beta7 -Pre
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

image

Really don't get it...

@304NotModified
Copy link
Member

304NotModified commented Feb 16, 2017

posted here: NuGet/Home#4639

don't get why net451 dependencies influences net461.

@304NotModified
Copy link
Member

304NotModified commented Feb 17, 2017

as we needed "System.Runtime": { "type": "build" } instead of "System.Runtime": "" or "System.Runtime": "4.0.0.0"

tested it, and worked :)

This will be fixed in beta3! Release, today

@304NotModified
Copy link
Member

@jamesbperry
Copy link

Wow, y'all are great. Beta 3 does the trick! Thanks.

@304NotModified
Copy link
Member

Thanks for the confirm!

If you help us with #86 ;), that would be great :)

@jamesbperry
Copy link

See PR #99 :)

@304NotModified
Copy link
Member

Thanks man! Appreciate it!

@nareshpatel
Copy link

I am seeing same error again with 1.0.0-rtm-rc4 for 4.5.2 framework project (VS 2015) :(

@304NotModified
Copy link
Member

what is the nlog version you're using?

@nareshpatel
Copy link

I am using NLog.4.5.0-rc03

@304NotModified 304NotModified added this to the 1.0.0-rtm-rc5 milestone Dec 19, 2017
@304NotModified
Copy link
Member

strange, as far as I understand this issue should not be there because we moved to VS 2017 csproj: NuGet/Home#4639

Could you try adding

 "System.Runtime": { "type": "build" } 

to your project.json? (or aren't you using project.json?)

@snakefoot
Copy link
Contributor

snakefoot commented Dec 21, 2017

Have created #185 to remove System.Runtime dependency for net451 and net461 (And added support for NetCoreApp10, and not just NetCoreApp11)

@snakefoot
Copy link
Contributor

@nareshpatel Thank you for reporting this. Think some garbage was transferred over in the conversion of NLog-Extensions from project.json to Vs2017-csproj.

@304NotModified
Copy link
Member

will be fixed in rtm-rc5

@snakefoot
Copy link
Contributor

@nareshpatel NLog.Extensions.Logging RC5 has been released: https://www.nuget.org/packages/NLog.Extensions.Logging/1.0.0-rtm-rc5

@nareshpatel
Copy link

Thank you @304NotModified and @snakefoot :) I was able to install rc5 package without any errors and logs are working

@304NotModified
Copy link
Member

👍 thanks @snakefoot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants