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

FYI (Dev. Env. Broke): Today Windows Update (!) installed .NET SDK 5.0.1 and uninstalled .NET SDK 5.0.200-preview.20601.7 #5781

Open
JeepNL opened this issue Dec 22, 2020 · 18 comments
Assignees
Labels
area-setup Issues related to installing .NET Core

Comments

@JeepNL
Copy link

JeepNL commented Dec 22, 2020

I'm using the latest previews, e.g. .NET SDK / Visual Studio.

Dev. environment broke after Windows Update installed .NET SDK 5.01 and uninstalled .NET SDK 5.0.200-preview.20601.7

And because .NET SDK 5.0.200-preview.20601.7 is not available for download (see my previous issue: #5734) I had to do a repair of Visual Studio Preview.

@JeepNL
Copy link
Author

JeepNL commented Dec 22, 2020

And even the repair doesn't help. It doesn't install .NET SDK 5.0.200-preview.20601.7.

So, now I can't do anything anymore.

@JeepNL JeepNL changed the title FYI: Today Windows Update (!) installed .NET SDK 5.0.1 and uninstalled .NET SDK 5.0.200-preview.20601.7 FYI (Dev. Env. Broke)): Today Windows Update (!) installed .NET SDK 5.0.1 and uninstalled .NET SDK 5.0.200-preview.20601.7 Dec 22, 2020
@JeepNL JeepNL changed the title FYI (Dev. Env. Broke)): Today Windows Update (!) installed .NET SDK 5.0.1 and uninstalled .NET SDK 5.0.200-preview.20601.7 FYI (Dev. Env. Broke): Today Windows Update (!) installed .NET SDK 5.0.1 and uninstalled .NET SDK 5.0.200-preview.20601.7 Dec 22, 2020
@JeepNL
Copy link
Author

JeepNL commented Dec 22, 2020

Okay, got it running again.

  1. Uninstalled (Control Panel -> Program and Features or Settings -> Apps -> Apps & Features) every dotnet sdk I could find.

  2. Deleted everything in "C:\Program Files\dotnet" & "C:\Program Files (x86)\dotnet" incl. subdirs.

  3. Did a Visual Studio Preview Repair.

@dagood
Copy link
Member

dagood commented Dec 22, 2020

@joeloff any ideas? Is this related to dotnet/sdk#14916 ?

/cc @dleeapho @NikolaMilosavljevic

@dagood dagood added the area-setup Issues related to installing .NET Core label Dec 22, 2020
@joeloff
Copy link
Member

joeloff commented Dec 22, 2020

No, 14916 is related to when people install both x86/x64 runtimes, but then only install a single SDK. Depending on the runtime you installed last the PATH variable can end up pointing to the runtime that doesn't have a matching SDK.

Currently, only 5.0.101 is offered in Microsoft Update. @JeepNL, do you have logs (look in your %temp% folder)? 5.0.1xx band should not update 5.0.2xx as they're intended for SxS use.

Also, which VS version did you have installed that offered the 2xx preview for you?

@joeloff
Copy link
Member

joeloff commented Dec 22, 2020

I'm busy setting up a repro machine

@JeepNL
Copy link
Author

JeepNL commented Dec 22, 2020

.NET SDK 5.0.200-preview.20601.7 was installed by Visual Studio v16.9.0 Preview 2.0 (see my issue: #5734)

I think it you can reproduce this

  1. delete all .NET SDKs

  2. Repair (or install) Visual Studio v16.9.0 Preview 2.0 (at least web & desktop development and multi platform)
    2b) run dotnet --info you'll see .NET SDK 5.0.200-preview.20601.7

  3. Run Windows Update. It'll install .NET 5.01
    3b) run dotnet --info: .NET SDK 5.0.200-preview.20601.7 is gone, Not available to any solution in Visual Studio Preview. (In solution explorer all projects, configured to use the latest sdk, show: project unloaded)

I got it running again by: (in this order)

a) Deleted all .NET SDKs (Programs & Features)

b) Deleted everything from: (maybe too much, I don't know, I wanted it all gone, it's my dev PC, I need it to work)
C:\Users\xxxxx\.dotnet
C:\Users\xxxxx\.nuget
C:\Users\xxxxx\AppData\Local\Microsoft\dotnet
C:\Users\xxxxx\AppData\Local\NuGet
C:\Users\xxxxx.templateengine\dotnetcli
C:\Program Files\dotnet
C:\Program Files (x86)\dotnet
C:\ProgramData\Package Cache\

c) Do a Windows Update which installs .NET 5.01)

d) repair Visual Studio Preview (which installs .NET SDK 5.0.200-preview.20601.7)

e) Additionally I needed to download and install ".NET Desktop Runtime 5.0.1" from https://dotnet.microsoft.com/download/dotnet/5.0 (https://dotnet.microsoft.com/download/dotnet/thank-you/runtime-desktop-5.0.1-windows-x64-installer)

The last step e) for EF Core 5.01 CLI to work.

@JeepNL
Copy link
Author

JeepNL commented Dec 22, 2020

FYI it's almost 01:00 AM where I live, so I'll check in again tomorrow.

@joeloff
Copy link
Member

joeloff commented Dec 23, 2020

I've got a good idea what's going on here, but hoping your logs will confirm:

Can you open a powershell prompt (as admin), then run Get-WindowsUpdateLog. This will process the update ETL traces and should drop WindowsUpdate.log file in your desktop. Open the file and search for ".NET 5.0.1"

You should see something similar to this:

020/12/22 15:45:30.3972604 1548 8244 Agent Title = 2020-12 .NET 5.0.1 Update for x64 Client
2020/12/22 15:45:30.3972630 1548 8244 Agent UpdateId = 3E0FD259-CDA4-4BA9-A0DA-C9D5F7CD87C6.200
2020/12/22 15:45:30.3972638 1548 8244 Agent Bundles 4 updates:
2020/12/22 15:45:30.3972662 1548 8244 Agent D81E9A6E-7FC2-44DD-ACFD-CF41DA0737DF.200
2020/12/22 15:45:30.3972683 1548 8244 Agent 2835A1B8-6F5B-4DE6-9E44-2613A2D15C10.200
2020/12/22 15:45:30.3972704 1548 8244 Agent 25C754BD-C4F8-4D10-B05A-9A1AAA5490AD.200
2020/12/22 15:45:30.3972783 1548 8244 Agent 6012CDDE-3C8A-40D8-A2B8-CA4E9440B5D2.200

Very important, if you open an admin prompt and run dir \windows\temp\*5.0.1*.log, can you list the order of the log files and their timestamps (you must be admin to access the logs in windows\temp)

@jamshedd jamshedd self-assigned this Dec 23, 2020
@jamshedd
Copy link
Member

@JeepNL, it would be good to know what your system PATH looked like (when in the broken state). I realize you've unwound the stack and cleaned this up, but if you have any other machines with the repo or get into this state again please let us know what you find.

@JeepNL
Copy link
Author

JeepNL commented Dec 23, 2020

@joeloff

  1. Screenshot log files dir *5.0.1*.log

Screenshot 2020-12-23 115436

  1. Zip file of WindowsUpdate.log (December 22nd, 2020) (it's the whole log of yesterday, I see 7 'instances' of .NET 5.0.1 Update I did a lot of testing, repairs and installs. WindowsUpdate.zip

@JeepNL
Copy link
Author

JeepNL commented Dec 23, 2020

@jamshedd

I do not have another development PC, and you're probably right about the PATH: where I said Windows Update did an 'uninstall' of .NET SDK 5.0.200-preview.20601.7 it probably didn't uninstall it, something else was going on. I just couldn't see the SDK anymore with dotnet --info and it wasn't available anymore within Visual Studio Preview.

@JeepNL
Copy link
Author

JeepNL commented Dec 23, 2020

FYI
My PC now after a) uninstall / manual deleted everything .NET (sdk) related, b) did a Windows Update, c) Repair of Visual Studio Preview and d) manual download & install of NET Desktop Runtime 5.0.1

dotnet --info

Screenshot 2020-12-23 123239

PATH

Screenshot 2020-12-23 123450

@joeloff
Copy link
Member

joeloff commented Dec 23, 2020

I noticed that that the x86 copy of dotnet is first on the path. That is likely what tripped everything up. Thanks for all the data and prompt replies. I'll go over the data today. If you were to open an arbitrary prompt, I'd expect dotnet --info to not list any SDKs. From the PS prompt though it appears to be running from Program File and not Program Files (x76).

@JeepNL
Copy link
Author

JeepNL commented Dec 24, 2020

Yes, I don't know why the x86 path is first in the list, I didn't manually edit the order. My PC config worked before Windows Update installed .NET 5.01. I did the update when I worked on a project in Visual Studio, rebooted my PC and then it stopped working when I opened Visual Studio again. The Windows Update was the only thing that happened in between.

When I open een 'normal' command prompt (ie: 'cmd' in File Explorer) I get the same result (see screenshot: dotnet --info & path). After taking the screenshot I changed the order of the dotnet paths.

I do not know if this issue needs to stay open. If you've got everything you need, or if this issue has been resolved you can close it if you want. Thank you for your replies and I wish you a merry Christmas and a happy New Year!

Screenshot 2020-12-24 113231

@joeloff
Copy link
Member

joeloff commented Dec 24, 2020

Thanks @JeepNL, same to you and thanks for all the information. For now we can keep the issue open. We've seen something similar happen when users sometimes mix x86/x64 where the x86 path ends up first and the host resolves to the 32-bit copy. The reboot might be crux of the issue.

Setting the environment variable is tied to the same component that installs dotnet.exe. If the restart manager decides to defer the file being installed, it's possible the PATH update happens after a reboot too. We always append to PATH, and we always install x86 after x64 which has mad this issue difficult to repro.

@joeloff
Copy link
Member

joeloff commented Dec 24, 2020

@JeepNL Can you please send me the log files from the Windows\Temp folder, specifically the dotnet_host ones (both x86 and x64).

Then from your %temp% folder, look for all dd*SharedHost*.log files and include those as well. I need to piece together the whole sequence of events.

@JeepNL
Copy link
Author

JeepNL commented Dec 25, 2020

@joeloff I couldn't find any dd*SharedHost*.log files but in the zip file I've included dd*AspNetCoreSharedFramework*.log (x86/x64) files and some other logfiles related to Visual Studio and .NET. The dd*AspNetCoreSharedFramework*.log files are from the date (22nd) I ran into the problem

Logs.zip

If this doesn't help you I could try to reproduce the issue myself on my PC.

@carlossanlop
Copy link
Member

Ping @joeloff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-setup Issues related to installing .NET Core
Projects
None yet
Development

No branches or pull requests

5 participants