diff --git a/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProjectTracker_IVsSolutionLoadEvents.cs b/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProjectTracker_IVsSolutionLoadEvents.cs index 519e313883a2343dda48630b8feb741e84b03814..fa18ce435215b22cdff81ae6ac50f9c51ebe5e97 100644 --- a/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProjectTracker_IVsSolutionLoadEvents.cs +++ b/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProjectTracker_IVsSolutionLoadEvents.cs @@ -196,7 +196,7 @@ private void OutputToOutputWindow(string message) } var commandLineParser = _workspaceServices.GetLanguageServices(languageName).GetService(); - var projectDirectory = Path.GetDirectoryName(projectFilename); + var projectDirectory = PathUtilities.GetDirectoryName(projectFilename); var commandLineArguments = commandLineParser.Parse( projectInfo.CommandLineArguments, projectDirectory, @@ -204,7 +204,7 @@ private void OutputToOutputWindow(string message) sdkDirectory: RuntimeEnvironment.GetRuntimeDirectory()); // TODO: Should come from sln file? - var projectName = Path.GetFileNameWithoutExtension(projectFilename); + var projectName = PathUtilities.GetFileName(projectFilename, includeExtension: false); var projectId = GetOrCreateProjectIdForPath(projectFilename, projectName); // See if we've already created this project and we're now in a recursive call to @@ -306,7 +306,15 @@ private void OutputToOutputWindow(string message) foreach (var reference in commandLineArguments.AnalyzerReferences) { - projectContext.AddAnalyzerReference(reference.FilePath); + var path = reference.FilePath; + if (!PathUtilities.IsAbsolute(path)) + { + path = PathUtilities.CombineAbsoluteAndRelativePaths( + projectDirectory, + path); + } + + projectContext.AddAnalyzerReference(path); } return (AbstractProject)projectContext; @@ -314,7 +322,7 @@ private void OutputToOutputWindow(string message) private static string GetLanguageOfProject(string projectFilename) { - switch (Path.GetExtension(projectFilename)) + switch (PathUtilities.GetExtension(projectFilename)) { case ".csproj": return LanguageNames.CSharp;