Closed marchy closed 5 years ago
I just tried it with both samples from this repo, and with another solution created from scratch that contains a .netcore project, along with a global.json file that points to '2.2.102'.
And I just noticed you said '2.2.201'. There isn't a '201' yet. Maybe that's the problem?
Ahh my bad, typo in the message. I meant '2.2.102' and double-checked that's indeed what we were trying.
I tried now in the Migrator.EF6 sample projects and simply adding the following global.json file under 'Solution Items' causes the problem to happen:
{
"projects": [ "." ],
"sdk": {
"version": "2.2.102"
}
}
Once that gets changed to '2.1.403' the command line tool works fine again, so it seems like even running a previous-version project in the 2.2 runtime causes the issue to surface.
I'm sorry I still can't reproduce it. I tried putting the exact global.json above in this repo's root folder. It still worked.
Maybe it's related to sdk 1.0. I believe that's still necessary for Migrator.EF6 to run. I'm not sure. Did you uninstall some version?
What is the output of dotnet --info
?
I'm closing this, please reopen if you still have issues.
Hi @mrahhal, sorry for checking up on this for so long, we had to abandon the .NET Core 2.2 upgrade initiative and are just revisiting it now.
We tried matching your setup with the 1.1.7 versions and testing on 2.2.102, we're getting the same problem unfortunately =(
.NET Core SDK (reflecting any global.json):
Version: 2.2.102
Commit: 96ff75a873
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17763
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.2.102\
Host (useful for support):
Version: 2.2.1
Commit: 878dd11e62
.NET Core SDKs installed:
1.1.7 [C:\Program Files\dotnet\sdk]
2.1.403 [C:\Program Files\dotnet\sdk]
2.1.503 [C:\Program Files\dotnet\sdk]
2.1.701 [C:\Program Files\dotnet\sdk]
2.2.102 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Which version of .NET Framework are you running on by chance? https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed
Hello @marchy
I myself have 4.7.2. But in my team of 6, each probably have different versions. The only requirement they had to install were .net core sdk latest version (usually) + version 1.1.x (here).
This is again my setup:
.NET Core SDK (reflecting any global.json):
Version: 2.2.401
Commit: 729b316c13
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18362
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.2.401\
Host (useful for support):
Version: 2.2.6
Commit: 7dac9b1b51
.NET Core SDKs installed:
1.1.14 [C:\Program Files\dotnet\sdk]
2.1.801 [C:\Program Files\dotnet\sdk]
2.2.100 [C:\Program Files\dotnet\sdk]
2.2.401 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Can you try installing 1.1.14 sdk?
Hi Mohammad, I tried matching your versions, both with [1.1.7 + 2.2.102] earlier as well as [1.1.14 + 2.2.401] (and some combination of both).
.NET Core SDK (reflecting any global.json):
Version: 2.2.102
Commit: 96ff75a873
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17763
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.2.102\
Host (useful for support):
Version: 2.2.6
Commit: 7dac9b1b51
.NET Core SDKs installed:
1.1.14 [C:\Program Files\dotnet\sdk]
2.1.403 [C:\Program Files\dotnet\sdk]
2.1.503 [C:\Program Files\dotnet\sdk]
2.1.701 [C:\Program Files\dotnet\sdk]
2.2.102 [C:\Program Files\dotnet\sdk]
2.2.401 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
results in:
> dotnet ef6 migrations list
Version for package `Migrator.EF6.Tools` could not be resolved.
with 'global.json' being:
{
"projects": [ "." ],
"sdk": {
"version": "2.2.102"
}
}
Is there any way to dive deeper / step through / debug the project to see what's happening in the tool? The above were all issued from the command line testing against the BasicConsoleApp sample in the project, but I'd like to try debugging and seeing where exactly it's failing.
UPDATE: Okay this is extremely strange. I ran a debug session against the project (with setting the execution path to be the BasicConsoleApp sample project that references the tool) and not only did the debug session work, but now the command line is working as well – for both the sample projects and others!
Could it be that the way the tools get registered with the dotnet CLI tool reference was somehow cached using an older version of the tool? Not sure how to check caches of this, my %USERPROFILE%\.dotnet\tools
directory is empty and I tried running 'dotnet tool list -g' and 'dotnet tool list --tool-path ../../src/Migrator.EF6.Tools' from the sample project directory but both return empty.
Wow..
Yeah to start with, debugging tools is seriously inconvenient, I haven't been able to do that properly in the past, not sure if anything changed.
Could it be that the way the tools get registered with the dotnet CLI tool reference was somehow cached using an older version of the tool?
I really doubt that if you've ever updated the version of the tool. NuGet will definitely obtain the newest version.
my %USERPROFILE%.dotnet\tools directory is empty
You'll need to check %USERPROFILE%\.nuget\packages\.tools
(unless if that's a typo)
'dotnet tool list -g'
Yeah it won't be there since this is not a global tool.
So this is weird, but so, once you debugged your sample it started working? Did you repro this on other machines? (Though, I think you told me this problem only occurs on 1 machine?)
This was happening on two additional machines previously, though did not try it on the other one this time around. We've actually got the 2.2 upgrade / 3.0 assessment scheduled for the end of September so I'll check against the one other machine to repro, and I'll check both what files are there beforehand and what changes if the same debugging trick resolves it.
The path above wasn't a typo, we took it from this article (https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools) but I guess that must not apply for NuGet packages. I do see the Migrator.EF6 tool in the %USERPROFILE%\.nuget\packages\.tools
path you mention – there's both a netcoreaapp2.1 and netcoreapp2.2 directory in there.
I'll update with any new findings when we do our full upgrade at the end of next month. Thanks again for your help and promptness on everything Mohammad!
No worries! Glad you were able to get it to work, please do keep me updated.
Switching over to .NET Core 2.2 makes the
dotnet ef6
command error with:Version for package 'Migrator.EF6.Tools' could not be resolved.
This can be tested by pointing the global.json file in a solution containing a .NET Core project from '2.1.403' to '2.2.201'.
Note that running the Console app in the Migrator.EF6 runs fine - so something is incompatible with the integration into the dot net tools/toolchain.
UPDATE: The .NET Core version tried above is actually '2.2.102' – typo in the message above.