CZEMacLeod / MSBuild.SDK.SystemWeb

This MSBuild SDK is designed to allow for the easy creation and use of SDK (shortform) projects targeting ASP.NET 4.x using System.Web.
MIT License
151 stars 8 forks source link

Microsoft.CodeDom.Providers.DotNetCompilerPlatform should use the latest version dependant on the target framework version #59

Open CZEMacLeod opened 1 year ago

CZEMacLeod commented 1 year ago

The package Microsoft.CodeDom.Providers.DotNetCompilerPlatform now has versions 3.11.0 and 4.1.0 released. The SDK should use the new version where possible. If the TargetFramework is net472 or higher we can use 4.1.0. For net462 or higher we can use 3.11.0. If we are trying to target older than net462 (up to net45) we need to keep on the current 3.6.0 version.

CZEMacLeod commented 1 year ago

This may need to be reworked based on the work in #56 and #54.

  <ItemGroup>
    <_SDKPackageReference Update="Microsoft.CodeDom.Providers.DotNetCompilerPlatform"
                          SDKDefaultVersion="3.11.0"
                          Condition="$([System.Version]::Parse('$(TargetFrameworkVersion.Substring(1))').CompareTo($([System.Version]::Parse('4.6.2')))) &gt;= 0" />
    <_SDKPackageReference Update="Microsoft.CodeDom.Providers.DotNetCompilerPlatform"
                          SDKDefaultVersion="4.1.0"
                          Condition="$([System.Version]::Parse('$(TargetFrameworkVersion.Substring(1))').CompareTo($([System.Version]::Parse('4.7.2')))) &gt;= 0" />
  </ItemGroup>