{"action":"closed","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/4660","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/4660/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/4660/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/4660/events","html_url":"https://github.com/dotnet/roslyn/issues/4660","id":102022049,"number":4660,"title":"MSBuildWorkspace should add Project references correctly","user":{"login":"NanosoftDK","id":6203625,"avatar_url":"https://avatars.githubusercontent.com/u/6203625?v=3","gravatar_id":"","url":"https://api.github.com/users/NanosoftDK","html_url":"https://github.com/NanosoftDK","followers_url":"https://api.github.com/users/NanosoftDK/followers","following_url":"https://api.github.com/users/NanosoftDK/following{/other_user}","gists_url":"https://api.github.com/users/NanosoftDK/gists{/gist_id}","starred_url":"https://api.github.com/users/NanosoftDK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NanosoftDK/subscriptions","organizations_url":"https://api.github.com/users/NanosoftDK/orgs","repos_url":"https://api.github.com/users/NanosoftDK/repos","events_url":"https://api.github.com/users/NanosoftDK/events{/privacy}","received_events_url":"https://api.github.com/users/NanosoftDK/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/API","name":"API","color":"fc2929"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-IDE","name":"Area-IDE","color":"5319e7"}],"state":"closed","locked":false,"assignee":{"login":"mattwar","id":3387305,"avatar_url":"https://avatars.githubusercontent.com/u/3387305?v=3","gravatar_id":"","url":"https://api.github.com/users/mattwar","html_url":"https://github.com/mattwar","followers_url":"https://api.github.com/users/mattwar/followers","following_url":"https://api.github.com/users/mattwar/following{/other_user}","gists_url":"https://api.github.com/users/mattwar/gists{/gist_id}","starred_url":"https://api.github.com/users/mattwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattwar/subscriptions","organizations_url":"https://api.github.com/users/mattwar/orgs","repos_url":"https://api.github.com/users/mattwar/repos","events_url":"https://api.github.com/users/mattwar/events{/privacy}","received_events_url":"https://api.github.com/users/mattwar/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/3","html_url":"https://github.com/dotnet/roslyn/milestones/1.1","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/3/labels","id":937401,"number":3,"title":"1.1","description":"This is our 1.1 Milestone.\r\n\r\n<!---\r\n@huboard:{\"order\":1.5}\r\n-->\r\n","creator":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"open_issues":207,"closed_issues":544,"state":"open","created_at":"2015-01-15T20:48:41Z","updated_at":"2015-10-09T19:20:42Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-08-19T23:22:57Z","updated_at":"2015-10-09T19:20:42Z","closed_at":"2015-10-09T19:20:42Z","body":"While using MsBuildWorkspace to add project references to a project.\r\nWorking on project file: \"C:\\source\\project1\\project1.csproj\"\r\nand adding project reference to: \"C:\\source\\project1.foo\\project1.foo.csproj\"\r\n\r\nthe project reference vil get an incorrect relative path as: \".foo\\project1.foo.csproj\"\r\nit should have been: \"..\\project1.foo\\project1.foo.csproj\"\r\n\r\nthe bug is in: roslyn/src/Workspaces/Core/Desktop/InternalUtilities/FilePathUtilities.cs\r\n\r\n```C#\r\n        public static bool IsNestedPath(string basePath, string fullPath)\r\n        {\r\n            return fullPath.StartsWith(basePath, StringComparison.OrdinalIgnoreCase);\r\n        }\r\n```\r\nAdding a backslash probably solves the bug.\r\n\r\n```C#\r\n        public static bool IsNestedPath(string basePath, string fullPath)\r\n        {\r\n            return fullPath.StartsWith(basePath + \"\\\", StringComparison.OrdinalIgnoreCase);\r\n        }\r\n```\r\n\r\nI will happily make a repro project if needed, or a PR for the fix"}}