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

Need external dependencies to support .NET Standard in order to remove the requirement for imports in project.json #5176

Closed
divega opened this issue Apr 26, 2016 · 23 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-unknown
Milestone

Comments

@divega
Copy link
Contributor

divega commented Apr 26, 2016

Two of EF Core's dependencies, Remotion.Linq and Ix-Async currently use pre-existing portable targets to support multiple platforms. Until these packages add support for .NET Standard, libraries or applications using EF Core will need to specify additional import attributes in project.json.

    Package Ix-Async 1.2.5 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). 
    Package Ix-Async 1.2.5 supports:
      - net40 (.NETFramework,Version=v4.0)
      - net45 (.NETFramework,Version=v4.5)
      - portable-net45+win8+wp8 (.NETPortable,Version=v0.0,Profile=Profile78)
    Package Remotion.Linq 2.0.2 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). 
    Package Remotion.Linq 2.0.2 supports:
      - net35 (.NETFramework,Version=v3.5)
      - net40 (.NETFramework,Version=v4.0)
      - net45 (.NETFramework,Version=v4.5)
      - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)

These two issues track the necessary changes in our dependencies:

dotnet/reactive#174
https://www.re-motion.org/jira/browse/RMLNQ-98

Cc: @natemcmaster @rowanmiller

@divega divega changed the title Need external dependencies to support .NET Standard in order to remove the need for imports Need external dependencies to support .NET Standard in order to remove the requirement for imports in project.json Apr 26, 2016
@rowanmiller rowanmiller added this to the 1.0.0 milestone Apr 26, 2016
@bickycheese
Copy link

Hi what is the supposed workaround?

@natemcmaster
Copy link
Contributor

Use "imports" in project.json.

"frameworks": {
    "netcoreapp1.0": {
       "imports": "portable-net451+win8"
    }
}

@bickycheese
Copy link

Hi, still getting EntityFramework.Core 7.0.0-rc1-final is not compatible with .NETPlatform,Version=v5.0.

@davidfowl
Copy link
Member

@stannynuytkens can you provide more details? That looks you have a bad project.json

@bickycheese
Copy link

{
"supports": {
"net46.app": {},
"dnxcore50.app": {}
},
"dependencies": {
"Microsoft.NETCore": "5.0.0",
"Microsoft.NETCore.Portable.Compatibility": "1.0.0"
},
"frameworks": {
"dotnet": {
"imports": "portable-net451+win8"
}
}
}

@bickycheese
Copy link

Just trying to add EntityFramework.Core to a 4.6.1 Portable class library for use in a .net core app.

@bickycheese
Copy link

Full output:

Restoring packages for 'BitBite.Data'.
Restoring packages for C:\Users\nuytk\Documents\Visual Studio 2015\Projects\BitBite\BitBite.Data\project.json...
Detected package downgrade: System.Reflection from 4.1.0-beta-23225 to 4.0.10
BitBite.Data (>= 1.0.0) -> EntityFramework.Core (>= 7.0.0-rc1-final) -> Microsoft.Extensions.DependencyInjection.Abstractions (>= 1.0.0-rc1-final) -> System.Reflection (>= 4.1.0-beta-23225)
BitBite.Data (>= 1.0.0) -> EntityFramework.Core (>= 7.0.0-rc1-final) -> System.Reflection (>= 4.0.10)
Detected package downgrade: System.Reflection from 4.1.0-beta-23225 to 4.0.10
BitBite.Data (>= 1.0.0) -> EntityFramework.Core (>= 7.0.0-rc1-final) -> Microsoft.Extensions.Logging.Abstractions (>= 1.0.0-rc1-final) -> System.Reflection (>= 4.1.0-beta-23225)
BitBite.Data (>= 1.0.0) -> EntityFramework.Core (>= 7.0.0-rc1-final) -> System.Reflection (>= 4.0.10)
Version conflict detected for System.Collections.
BitBite.Data (>= 1.0.0) -> EntityFramework.Core (>= 7.0.0-rc1-final) -> System.Collections (>= 4.0.11-beta-23516)
BitBite.Data (>= 1.0.0) -> Microsoft.NETCore.Portable.Compatibility (>= 1.0.0) -> Microsoft.NETCore.Runtime (>= 1.0.0) -> Microsoft.NETCore.Runtime.CoreCLR-x86 (>= 1.0.0) -> System.Collections (= 4.0.10).
EntityFramework.Core 7.0.0-rc1-final is not compatible with .NETPlatform,Version=v5.0.
Some packages are not compatible with .NETPlatform,Version=v5.0.
Ix-Async 1.2.5 is not compatible with DNXCore,Version=v5.0.
Remotion.Linq 2.0.1 is not compatible with DNXCore,Version=v5.0.
Some packages are not compatible with DNXCore,Version=v5.0.
Ix-Async 1.2.5 is not compatible with DNXCore,Version=v5.0 (win7-x86).
Remotion.Linq 2.0.1 is not compatible with DNXCore,Version=v5.0 (win7-x86).
Some packages are not compatible with DNXCore,Version=v5.0 (win7-x86).
Ix-Async 1.2.5 is not compatible with DNXCore,Version=v5.0 (win7-x64).
Remotion.Linq 2.0.1 is not compatible with DNXCore,Version=v5.0 (win7-x64).
Some packages are not compatible with DNXCore,Version=v5.0 (win7-x64).
Package restore failed for 'BitBite.Data'.
Package restore failed. Rolling back package changes for 'BitBite.Data'.
========== Finished ==========

@davidfowl
Copy link
Member

Yea, the project.json isn't right. You can't use the dotnet TFM (it's pretty much deprecated at this point). What are you trying to do? Write a portable class library that uses EF Core?

@bickycheese
Copy link

Hi David, yeah that's about exactly what I'm trying to do. =)

@davidfowl
Copy link
Member

First thing you need to do is install update 2 and change the portable class library to a .NET Standard class library by right clicking and using the project properties. Also make sure you have the latest version of the NuGet client

@bickycheese
Copy link

bickycheese commented May 4, 2016

Thank you David, will do.

EDIT: that works but I can't add a reference to my data library from the dotnetcore project.
The error states https://onedrive.live.com/redir?resid=B23C8D8FE481E2C3!27913&authkey=!AAc_d6GmlZ6Y8q4&v=3&ithint=photo%2cPNG

@natemcmaster
Copy link
Contributor

@stannynuytkens this conversation has deviated from the original issue. Can you open a new issue on http://github.com/aspnet/home?

@clairernovotny
Copy link
Member

clairernovotny commented May 17, 2016

We have an unofficial build of Ix-Async here that has netstandard support. Work is in progress to make it official.

dotnet/reactive#148 (comment)

http://myget.org/gallery/rxnet

@natemcmaster
Copy link
Contributor

@onovotny good news.

Work is in progress to make it official.

I assume this is why the assemblies aren't strong-named yet?

@clairernovotny
Copy link
Member

clairernovotny commented May 17, 2016

Bingo. We could do an OSS sign but the Rx.NET repo only has the public keys checked in. There are two things we need -- the full SNK and Authenticode. The Authenticode signing will be moving to the .NET Foundation, not sure how this affects the strong name, or are those separate?

@natemcmaster
Copy link
Contributor

@onovotny IIUC strong name and authenticode are separate. e.g. EF nightly builds on myget.org/gallery/aspnetcidev have been built with strong-named signing but haven't been code-signed yet.

Side note: I'm testing the builds on http://myget.org/gallery/rxnet. Where should I file issues? Do you have a fork?

natemcmaster pushed a commit to natemcmaster/EntityFrameworkCore that referenced this issue Jun 7, 2016
natemcmaster pushed a commit to natemcmaster/EntityFrameworkCore that referenced this issue Jun 7, 2016
natemcmaster pushed a commit to natemcmaster/EntityFrameworkCore that referenced this issue Jun 8, 2016
@natemcmaster
Copy link
Contributor

Merged #5689, which means using EF Core 1.0 won't require "imports" in .NET Core apps.

Thanks to @MichaelKetting @shiftkey @onovotny @bartdesmet for their work to update Ix-Async and Re-linq to support .NET Standard.

@clairernovotny
Copy link
Member

Quick question -- where are you currently pulling the Ix bits from? FWIW, the latest version on the myget feed is OSS signed with the SNK and has the granular dependencies applied.

@natemcmaster
Copy link
Contributor

@onovotny we mirrored System.Interactive.Async to our CI build feeds for now. http://myget.org/feed/aspnetcidev/package/nuget/System.Interactive.Async. When the updated version lands on NuGet.org, we will use that instead.

@wpostma
Copy link

wpostma commented Oct 21, 2016

So this is closed, but a project.json containing only dnxcore are still not compatible with EntityFrameworkCore.MicrosoftSqlServer? I still need this workaround:

"frameworks": {    "netstandard1.6": {
      "imports": [ "dnxcore50", "portable-net451+win8" ]
    }

When will this workaround go away?

@divega
Copy link
Contributor Author

divega commented Oct 21, 2016

@wpostma EntityFrameworkCore.MicrosoftSqlServer is an old package from when this issue existed. If you are using 1.0.0 RTM or greater you should use Microsoft.EntityFrameworkCore.SqlServer instead.

@wpostma
Copy link

wpostma commented Oct 21, 2016

What's odd then is that the VS IDE still picks up and suggests adding "EntityFrameworkCore.MicrosoftSqlServer" to my project.json when it can't find references to things like DbContext.
It's like intellisense doesn't notice that my project.json already is at .net core 1.0.1 (or 1.0.0) and suggests old junk?

@divega
Copy link
Contributor Author

divega commented Oct 21, 2016

@wpostma I am not sure how the suggestion mechanism works internally but I ran an experiment in my machine and it seems to remember packages that you have used in previous VS sessions. So I think this may be a good time to remove pre-RTM packages from other projects, local NuGet cache, etc.

@divega divega added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-unknown
Projects
None yet
Development

No branches or pull requests

9 participants