diff --git a/CHANGELOG.md b/CHANGELOG.md index d14b1a5415..7d7e501991 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All changes to the project will be documented in this file. +## [1.25.0] - not released yet + +* Fixed a bug where language version was not correctly read from .csproj projects. ([#961](https://github.com/OmniSharp/omnisharp-roslyn/issues/961)) + ## [1.24.0] - 2017-08-31 * Fixed a bug where an external code action DLL with missing dependencies would crash OmniSharp. diff --git a/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.ProjectData.cs b/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.ProjectData.cs index e00631945e..0bda8a2bf6 100644 --- a/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.ProjectData.cs +++ b/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.ProjectData.cs @@ -68,7 +68,7 @@ public ProjectData( TargetFrameworks = targetFrameworks; OutputKind = outputKind; - LanguageVersion = LanguageVersion; + LanguageVersion = languageVersion; AllowUnsafeCode = allowUnsafeCode; DocumentationFile = documentationFile; PreprocessorSymbolNames = preprocessorSymbolNames; diff --git a/test-assets/test-projects/HelloWorld/HelloWorld.csproj b/test-assets/test-projects/HelloWorld/HelloWorld.csproj index e67ec78742..c0318399b6 100644 --- a/test-assets/test-projects/HelloWorld/HelloWorld.csproj +++ b/test-assets/test-projects/HelloWorld/HelloWorld.csproj @@ -4,6 +4,7 @@ Exe netcoreapp1.0 false + 7.1 diff --git a/tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs b/tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs index 71dec7dc86..3c3367b7aa 100644 --- a/tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs @@ -1,5 +1,6 @@ using System.IO; using System.Threading.Tasks; +using Microsoft.CodeAnalysis.CSharp; using Microsoft.Extensions.Logging; using OmniSharp.MSBuild.ProjectFile; using OmniSharp.Services; @@ -50,6 +51,7 @@ public async Task HelloWorld_has_correct_property_values() Assert.Equal("netcoreapp1.0", projectFileInfo.TargetFrameworks[0]); Assert.Equal("bin/Debug/netcoreapp1.0/", projectFileInfo.OutputPath.Replace('\\', '/')); Assert.Equal(3, projectFileInfo.SourceFiles.Length); // Program.cs, AssemblyInfo.cs, AssemblyAttributes.cs + Assert.Equal(LanguageVersion.CSharp7_1, projectFileInfo.LanguageVersion); } }