nblumhardt / serilog-timings

Extends Serilog with support for timed operations
Apache License 2.0
218 stars 22 forks source link

Strange Error Installing from NuGet #4

Closed Mike-E-angelo closed 8 years ago

Mike-E-angelo commented 8 years ago

FWIW, I am getting the following error when trying to install the NuGet package (this is from a new Class Library from scratch -- with Serilog 1.5.14 installed within it):

Attempting to gather dependency information for package 'SerilogTimings.1.0.0-beta-26' with respect to project 'ClassLibrary1', targeting '.NETFramework,Version=v4.5.1'
Attempting to resolve dependencies for package 'SerilogTimings.1.0.0-beta-26' with DependencyBehavior 'Lowest'
Resolving actions to install package 'SerilogTimings.1.0.0-beta-26'
Resolved actions to install package 'SerilogTimings.1.0.0-beta-26'
Adding package 'SerilogTimings.1.0.0-beta-26' to folder '..\ClassLibrary1\packages'
Added package 'SerilogTimings.1.0.0-beta-26' to folder '..\ClassLibrary1\packages'
Install failed. Rolling back...
Package 'SerilogTimings.1.0.0-beta-26 : Serilog [1.5.14, )' does not exist in project 'ClassLibrary1'
Removing package 'SerilogTimings.1.0.0-beta-26 : Serilog [1.5.14, )' from folder '..\ClassLibrary1\packages'
Removed package 'SerilogTimings.1.0.0-beta-26 : Serilog [1.5.14, )' from folder '..\ClassLibrary1\packages'

The Serilog [1.5.14, ) is key, I am thinking. Maybe a bad token somewhere?

nblumhardt commented 8 years ago

Hi Mike,

Is it a new "package"-based (project.json) class library?

The package targets Serilog 1.5 for RTM .NET, and 2.0 on the Core platforms; your library probably needs to pick one or the other... Can you send project.json?

Cheers, Nick

BTW - thinking it may be easier going forward to just "RTM" a v1 of this library targeting Serilog 1.5, and get a dev branch targeting 2.0 going...

Mike-E-angelo commented 8 years ago

Hmm... no I am using regular .NET (4.5.1). No core/project.json. For reference, what you see above is from a new Class Library from File -> New.

nblumhardt commented 8 years ago

Thanks for the data, I'll give classic .NET 451 a shot and report back. Or possibly just RTM the 1.0 pointing at v1 of Serilog, since I can see these kinds of things being annoying with the current scheme...... :+1:

nblumhardt commented 8 years ago

Okay... I have absolutely no idea how this comes about, but tooling problems with System.Runtime.dll aren't anything new unfortunately.

To fix it:

  1. Manually add a reference to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Runtime.dll to your project
  2. Install SerilogTimings
  3. Remove the System.Runtime.dll reference
  4. Build

Any luck with this recipe?

johnkattenhorn commented 8 years ago

Worked for me!

Mike-E-angelo commented 8 years ago

Success! VERY sorry for the delayed reply here! I got bamboolzed on my project and have had this sitting on my TODO list for a while now. I just tried it and it worked! So, from my perspective this is now a "non-issue" and free to close!

nblumhardt commented 8 years ago

Call me crazy, but I've just bumped the version of this package to 2.0-rc and shifted the whole thing to Serilog 2.0.

https://github.com/nblumhardt/serilog-timings/commit/55298e1588cf8e3bd195b43aa5cfc1901a5a2dbb

The 1.0-* packages are still there for Serilog 1.5 support, but this issue makes them a bit painful. Time to move forward :-)