NLog.Extensions.Logging: Can't install on .NET 4.6.1 - System.Runtime not found in the GAC
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:
- Create a new C# console application for .NET 4.6.1
- 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
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 28 (17 by maintainers)
Wow, y’all are great. Beta 3 does the trick! Thanks.
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
I can finally reproduce the problem 😃
Unfortunately dunno what the cause of this problem is. Testing now