From 9f61ad51aa833046b1c9fd795010ec6d8945e1af Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Fri, 8 Apr 2016 12:52:57 -0500 Subject: [PATCH] Check if runtimeConfigPath exists before reading the file in IsPortableApp. If it doesn't exist, then it isn't a portable app. --- .../CommandResolution/PackagedCommandSpecFactory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactory.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactory.cs index db399bd3e..0fd1eb90e 100644 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactory.cs +++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactory.cs @@ -170,7 +170,7 @@ namespace Microsoft.DotNet.Cli.Utils ? Directory.EnumerateFiles(commandDir).FirstOrDefault(x => x.EndsWith("runtimeconfig.json")) : runtimeConfigPath; - if (runtimeConfigPath == null) + if (runtimeConfigPath == null || !File.Exists(runtimeConfigPath)) { return false; }