-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Problem with dotnet cli ef tools after upgrading to vs 2017 15.4.4 and november .net core rollup #10298
Comments
I have the same problem. |
I have same issue. |
Scaffold-DbContext fails silently after that same upgrade to VS 15.4.4 |
I have the same predicament. Error is occurring when running: I was able to work around this by adding this to the EF project:
|
Can confirm that 2.0.2 workaround works. Not really clear why. |
I am pretty sure this is a CLI (dotnet tools) problem, not an EF problem, since I get the same error with I have cleaned up my system, and only have the 2.0.3 SDK, runtime (x64 and x86) and windows server hosting packs, therefore, @spnm 's solution doesn't work, but @Wind010 's does. |
This is probably a dupe of https://github.com/dotnet/cli/issues/7901 |
@Eilon @natemcmaster @livarcocc Any ideas on this? |
I have been trying to repro this for a while now without much success, but this does seem like a CLI problem. |
This is a CLI/SDK bug that we now understand. I am duping this one to the one in the CLI: https://github.com/dotnet/cli/issues/7901 We will explain it there why this happens and a workaround and we are figuring out the vehicle to carry a fix for this. @ajcvickers can you close this bug? |
Thanks @livarcocc. Closing. |
Re-opening since it looks like there's work to do on our side. |
The suggestion in comments don't work for Windows 10 + VS 2017 15.4.4 + NetCore 2.0.3 SDK <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.0.1" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.1" />
</ItemGroup>
</Project> |
Neither for the 'Scaffold-DbContext' problem in a netcoreapp2.0 project |
I used the project config below, and it resolved the issue in my environment (Windows 10 + VS 2017 15.4.4 NetCore 2.0.3 SDK) for 'Scaffold-DbContext'
|
@lccarvalho This sounds like it could be a different issue. Can you please file a new issue including a sample project that reproduces what you are seeing? @heku .NET Standard class libraries are not supported directly by the EF tooling. You will need to target an actual framework (e.g. netcoreapp2.0) or specify a startup project that targets a framework. This issue is not about that, but about using a class library that targets on netcoreapp when there is no usable startup project. |
I've filed #10338 to improve the silently failing PMC commands. |
WorkaroundAdding the following to the project should also make it work. <PropertyGroup>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup> |
Tks, @bricelam, can confirm that your workaround works. @ajcvickers: will file new issue with sample project during weekend, please let me know if it is not necessary anymore. |
Thanks @ajcvickers for response. I specified the startup project indeed,but it didn't work. I open another issue #10342 to describe my problem in detail. |
@ajcvickers no need for a new issue, with help of the messages I could see that there was an error on my Scaffold command, everything works fine for me now |
Keeping the issue open for tracking purposes. |
There is the same problem with my project, the workaround to resolve it successfully is that remove the item 'C:\Program Files (x86)\dotnet' from the Path of Environment Variable because I found I did not install the right netcore version under X86. I have not tried to install the proper version with x86, appreciate that you tell me if you have done that test. |
This patch is approved for the Feb 2018 patch. Please send a PR to the appropriate branch, get it reviewed, and merge. Please consider adding a quirks-mode switch for this change. |
I found out that the dotnet cli commands can't run from ClassLibraries it needs .exe in order to execute the command. So I fixed my problem by adding new |
{
"runtimeOptions": {
"framework": {
"name": "Microsoft.NETCore.App",
"version": "2.0.0"
}
}
} This tells Without the file, EF Tools pass |
thanks! |
Still getting this error via Core 2.1.4 SDK within ClassLibrary. When will we be able to add EF to these using NUGET vs. manually as well?
dotnet ef migrations add InitialCreate
Does it not seem strange that I have to do this to get it to work on minor versions?
|
@cgountanis i still use the |
@cgountanis Unfortunately, the patch containing this fix has not yet been released. Release dates for patches is not something the EF team can influence very much, and there have been various reasons for delaying the patch release that are outside our control. I realize that this is frustrating and I apologize for that. We are, across .NET Core, working on making this process better, so hopefully it won't be such an issue going forward. |
Sounds good, will that fix the error when adding the tools via NUGET as well. Right now we have to add that line manually to do migrations etc...
|
@cgountanis No, that's a separate NuGet issue, tracked here: NuGet/Home#4190 |
Not sure if its an EFCore issue or cli
Steps to reproduce
Using Visual Studio Enterprise 2017 (v 15.4.4)
Add migration
dotnet ef migrations add [MigrationName]
Expected behavior
Migration created
Actual behavior
Error message :
The specified framework version '2.0' could not be parsed
The specified framework 'Microsoft.NETCore.App', version '2.0' was not found.
Check application dependencies and target a framework version installed at:
\
Alternatively, install the framework version '2.0'.
My project is a console library and the content of .csproj file is below:
So i tried to use global.json in the root of my project :
and the error was the same.
But when I changed global.json content to this :
It worked.
The text was updated successfully, but these errors were encountered: