-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
dotnet restore packages.config support #7922
Comments
dotnet restore does not support packages.config. Only csproj packagereferences. cc @emgarten to confirm. |
That is correct. We are considering adding packages.config restore support to dotnet restore, but it raises the question, should dotnet restore support projects that dotnet build and other commands do not? @livarcocc do you have any thoughts on the direction this should go? |
So if I understand correctly, what I'm trying to do is just not supported. I want to use EF's entity designer interface (database first), which is not supported in the .net core class library projects (with "net452" set as framework). This crashes when adding the EntityFramework edmx to the project. So I reverted to using a standard class library project. But then not only is the dotnet restore not restoring the packages (missing packages.config support), but also the dotnet msbuild is not executing the EntityDeploy msbuild task. I'd love having the dotnet cli also build my project's domain class library correctly when building my asp.net core app. That leaves me to the question, is support for this within scope? On adding the packages.config support: I'd say it is not necessary when the rest of the tool-chain does not benefit from it. If you can't build a project, you don't need packages restored for it. |
Supporting old style csproj files is not in scope for the CLI. @bricelam Do we intend to add support to dotnet core to the EF designer interface in VS? |
Not the Entity Framework 6 Tools for Visual Studio, no. But we have dotnet/efcore#1027 about creating a new designer for EF Core. The two existing EF Core-compatible designers that I know about are: We've considered adding CPS-based csproj support to the EF6 PMC commands (dotnet/ef6#146), but never to the Designer. |
@dodedodo33 Like I said, it is not in the plans for the CLI to supported legacy style csproj, so in this case, I would suggest you continue using VS 2017. |
@livarcocc Thanks for clarifying, I've found some work arounds to make it work in my build agent. I'll keep using this environment 'till EF core catches up :) |
@dodedodo33
|
Issue
Situation
Since the dotnet sdk does not support EF6 edmx with code generation I set up a full .net class library project for my domain, which I reference from a asp.net project. In visual studio I added the EntityFramework package with the manage nuget packages interface. This setup the project correctly and the default Visual Studio nuget package restore works fine, with no build errors. Using dotnet restore on the project just tells me there are no packages configured for the project and does not restore the EF package.
From my understanding the dotnet restore command is a driver that uses nuget to restore the packages. But the restore process differs from the nuget restore process.
Attempted fix
Since the packages.config seems to be ignored I tried using tags in the project file. This made dotnet restore recognise the packages, but it could not build correctly due to missing references. It seems the package reference way of including packages does not work with "classic" class libraries.
Workaround
As a workaround I downloaded nuget.exe (4.0) and used ".\nuget.exe restore" on the project which correctly restored all packages.
Steps to reproduce
Expected behavior
The packages are restored in the same way "nuget.exe restore" would with a recent version of nuget (4.0 supports the tag used in .net core projects) and the project builds succesfully.
Actual behavior
The packages are not recognized by the dotnet cli, it does not restore any package and the "dotnet (ms)build" command fails with reference issues.
Environment data
dotnet --info
output:The text was updated successfully, but these errors were encountered: