scientistproject / Scientist.net

A .NET library for carefully refactoring critical paths. It's a port of GitHub's Ruby Scientist library
MIT License
1.46k stars 95 forks source link

dnxcore50 not supported #54

Closed davezych closed 8 years ago

davezych commented 8 years ago

According to @jpsingleton in #35 (this comment), dnxcore50 is not supported. He gets an error saying:

NU1002 The dependency Scientist 1.0.0-alpha5 in project ... does not support framework DNXCore,Version=v5.0.

davezych commented 8 years ago

I think this has to do with confusion regarding the target frameworks, and nuget, and things constantly switching in the dotnet project.

We're targeting dotnet5.2, which in theory should allow this to run on .NET 4.5 and dnxcore50 among others. Nuget is showing dependencies on dnx451 and .NETPlatform 5.2, which isn't 100% correct (dotnet5.2 is actually .NETPlatform 5.1).

I haven't had a chance to test things fully, but we might have to change this to specifically target the different frameworks (i.e. target dnxcore50, net451, etc) on their own instead of using the dotnet5.2 monikor.

jpsingleton commented 8 years ago

Yeah, it is a bit of a moving target. RC2 should be out fairly soon and things will hopefully settle down.

jpsingleton commented 8 years ago

In RC2 I now get a different error.

Cycle detected: 
  Scientist (>= 1.0.0) -> Scientist (>= 1.0.0-alpha5) -> Scientist (>= 1.0.0-alpha5).

and

MSB4006 There is a circular dependency in the target dependency graph involving target "GetCopyToOutputDirectoryItems".
haacked commented 8 years ago

Anyone know how to fix this?

jpsingleton commented 8 years ago

FYI the above was for ASP.NET Core. With a console app I can't even restore the package.

Package Scientist 1.0.0-alpha5 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Scientist 1.0.0-alpha5 supports:
  - dnx451 (DNX,Version=v4.5.1)
  - dotnet5.2 (.NETPlatform,Version=v5.2)
One or more packages are incompatible with .NETCoreApp,Version=v1.0.

I think the PR targeting netstandard1.5 is the way to go. Although Dapper targets 1.3. project.json may change, but I wouldn't worry about that just yet.

joncloud commented 8 years ago

It looks like it should be able to rollback to target netstandard1.3 without any issues. The examples for what the monikers support indicates that there are a couple of pieces that this framework is not using. It may be possible to target a lower framework. I tried restoring/building with netstandard1.1 and everything seemed to work fine, however i'm just shooting in the dark here.

jpsingleton commented 8 years ago

As far as I understand things, these new targets allow you to balance functionality with platform support. Higher numbers support everything from the lower ones but add new APIs, as they are ported. So if you don't need those APIs you can target a lower version and support more platforms.

It probably doesn't matter for now, as you're only looking to add support for .NET Core. If it all works on netstandard1.3 then I'd just go with that. If you want to support more platforms in the future then sticking to the 1.1 APIs could be useful, but it's probably too early to say. The examples don't show what's new in 1.5.

jpsingleton commented 8 years ago

There's more information at https://dotnet.github.io/docs/core-concepts/libraries/libraries-with-cli.html and https://github.com/dotnet/corefx/blob/master/Documentation/architecture/net-platform-standard.md. Looks like they are up to 1.6 now.

jpsingleton commented 8 years ago

Thanks, I'll check alpha6 when I find some time.

jpsingleton commented 8 years ago

OK, I can install and build this for a .NET Core console app but for an ASP.NET Core web app I still get this error:

error: Cycle detected: 
error:   Scientist (>= 1.0.0) -> Scientist (>= 1.0.0-alpha6) -> Scientist (>= 1.0.0-alpha6).

It might just be in a weird state so I'll try with a fresh web app.

jpsingleton commented 8 years ago

Yeah, works fine with a new template. All good.

I might have some old files lurking around somewhere.

joncloud commented 8 years ago

I just gave this a double check, and I was successfully able to test alpha6 against a .NET Core RC2 Web API.

haacked commented 8 years ago

Thanks for testing it! :sparkles: