sdk icon indicating copy to clipboard operation
sdk copied to clipboard

dotnet restore FileNotFoundException: System.Linq, Version=4.0.2.0

Open guardrex opened this issue 10 years ago • 61 comments

Running dotnet restore with latest dotnet cli (1.0.0.1370 beta) on a proj that was restoring fine a couple of days ago under the prior dotnet cli (1.0.0.1306 beta) ...

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 
'System.Linq, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its 
dependencies. The system cannot find the file specified.
   at Microsoft.DotNet.Cli.Utils.DebugHelper.HandleDebugSwitch(String[]& args)
   at Microsoft.DotNet.Cli.Program.Main(String[] args)

Uninstalling 1.0.0.1370 beta and going back to 1.0.0.1306 beta, dotnet restore works again ...

log  : Committing restore...
log  : Restore completed in 376365ms.

guardrex avatar Feb 16 '16 17:02 guardrex

I don't quite understand how our CI is passing yet you hit something like this... Seems like we need to see if we're pushing what we think we're pushing.

/cc @piotrpMSFT

davidfowl avatar Feb 16 '16 17:02 davidfowl

Actually, it's not specific to the restore command:

image

kevinchalet avatar Feb 16 '16 22:02 kevinchalet

are folks seeing this on Windows only?

TheRealPiotrP avatar Feb 16 '16 22:02 TheRealPiotrP

Win10 only here

guardrex avatar Feb 16 '16 22:02 guardrex

do you have DOTNET_HOME set by chance? can you try deleting it? we recently removed the requirement but I worry that it's now overriding the default behavior...

TheRealPiotrP avatar Feb 16 '16 22:02 TheRealPiotrP

@piotrpMSFT

Yep, that licked it. I deleted the DOTNET_HOME env var and uninstalled. I rebooted and reinstalled -1370. It works. Thx. Go ahead and close when ready ... I'm good.

guardrex avatar Feb 16 '16 22:02 guardrex

Assigning to @schellap. Can CoreHost provide some useful diagnostics output in cases like this?

The scenario is legitimate. Someone has a DOTNET_HOME set which they used to point to a runtime installation directory. Later they deleted the runtime but forgot to unset DOTNET_HOME. How do we get them back into a good state?

TheRealPiotrP avatar Feb 16 '16 22:02 TheRealPiotrP

@GuardRex could you turn on set COREHOST_TRACE=1 and pastebin the output or relevant portion (search for coreclr)?

schellap avatar Feb 16 '16 23:02 schellap

@schellap Sure, I'll do it right after the Standup ends ... or when they get into the 4-hour Q&A part :smile:

guardrex avatar Feb 16 '16 23:02 guardrex

@piotrpMSFT how is the host copied to the stage2\bin? I have a weird feeling the CoreHost added to the publish graph is stomping on this host?

schellap avatar Feb 17 '16 00:02 schellap

@schellap are you able to get a local repro? Point DOTNET_HOME to an empty directory?

TheRealPiotrP avatar Feb 17 '16 00:02 TheRealPiotrP

Tried, no local repro with: https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/Latest/dotnet-win-x64.latest.zip

schellap avatar Feb 17 '16 00:02 schellap

@schellap I'll see if I can break it again for you (with trace) ... I'm really, really good at breaking stuff :monkey:

guardrex avatar Feb 17 '16 00:02 guardrex

https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/1.0.0.1370/dotnet-win-x64.1.0.0.1370.exe MSI install doesn't repro as well for me. Will wait for @GuardRex inputs.

schellap avatar Feb 17 '16 00:02 schellap

@schellap I'm going on it right now. I'll get back to you soon.

guardrex avatar Feb 17 '16 00:02 guardrex

@GuardRex strikes again!

TheRealPiotrP avatar Feb 17 '16 00:02 TheRealPiotrP

Can you set COREHOST_TRACE=1 and give me the trace of the dotnet restore?

schellap avatar Feb 17 '16 00:02 schellap

oh, sure ... brb

guardrex avatar Feb 17 '16 00:02 guardrex

trace.txt

now ... let's see what else I break today :skull:

guardrex avatar Feb 17 '16 00:02 guardrex