diff --git a/src/Microsoft.DotNet.Watcher.Core/Internal/Implementation/Project.cs b/src/Microsoft.DotNet.Watcher.Core/Internal/Implementation/Project.cs index d8175329b3..e0803c2d1f 100644 --- a/src/Microsoft.DotNet.Watcher.Core/Internal/Implementation/Project.cs +++ b/src/Microsoft.DotNet.Watcher.Core/Internal/Implementation/Project.cs @@ -48,7 +48,10 @@ namespace Microsoft.DotNet.Watcher.Core.Internal if (File.Exists(projectLockJsonPath)) { var lockFile = LockFileReader.Read(projectLockJsonPath, designTime: false); - ProjectDependencies = lockFile.ProjectLibraries.Select(dep => GetProjectRelativeFullPath(dep.Path)).ToList(); + ProjectDependencies = lockFile.ProjectLibraries + .Where(dep => !string.IsNullOrEmpty(dep.Path)) // The dependency path is null for xproj -> csproj reference + .Select(dep => GetProjectRelativeFullPath(dep.Path)) + .ToList(); } else {