Skip to content

Commit

Permalink
Add code to check for Microsoft.Build.CentralPackageVersions and use …
Browse files Browse the repository at this point in the history
…unversioned packages. Closes #26
  • Loading branch information
CZEMacLeod committed Jan 11, 2022
1 parent 573eb3f commit 5897588
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- Include versioned compilers unless ExcludeASPNetCompilers property is set or we are using Microsoft.Build.CentralPackageVersions -->
<ItemGroup Condition="'$(ExcludeASPNetCompilers)'=='false' AND '$(UsingMicrosoftCentralPackageVersionsSdk)'!='true'">
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="3.8.0" PrivateAssets="All"/>
<PackageReference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" Version="3.6.0" />
</ItemGroup>

<!-- Include unversioned compilers unless ExcludeASPNetCompilers property is set if we are using Microsoft.Build.CentralPackageVersions -->
<!-- See https://github.com/CZEMacLeod/MSBuild.SDK.SystemWeb/issues/26 and https://github.com/microsoft/MSBuildSdks/issues/320 -->
<!-- Requires Microsoft.Build.CentralPackageVersions Version 2.1.1 or higher -->
<ItemGroup Condition="'$(ExcludeASPNetCompilers)'=='false' AND '$(UsingMicrosoftCentralPackageVersionsSdk)'=='true'">
<PackageReference Include="Microsoft.Net.Compilers.Toolset" PrivateAssets="All"/>
<PackageReference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" />
</ItemGroup>

</Project>
6 changes: 2 additions & 4 deletions src/MSBuild.SDK.SystemWeb/Sdk/Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
<Reference Include="System.Web" />
</ItemGroup>

<ItemGroup Condition="'$(ExcludeASPNetCompilers)'=='false'">
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="3.8.0" PrivateAssets="All"/>
<PackageReference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" Version="3.6.0" />
</ItemGroup>
<!-- Default packages -->
<Import Project="MSBuild.SDK.SystemWeb.DefaultPackages.targets" />

<PropertyGroup Condition="'$(MvcBuildViews)'==''">
<MvcBuildViews Condition="'$(Configuration)'=='Release'">true</MvcBuildViews>
Expand Down

0 comments on commit 5897588

Please sign in to comment.