Skip to content

Commit ffd1186

Browse files
committed
Add SetRoslynToolPath property to control setting RoslynToolPath automatically Closes #55
1 parent bfba0cd commit ffd1186

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/MSBuild.SDK.SystemWeb.CommonFiles/Sdk/MSBuild.SDK.SystemWeb.Common.DefaultPackages.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<!-- Include compilers unless ExcludeDefaultSDKPackages property is set -->
1111
<ItemGroup Condition="'$(ExcludeDefaultSDKPackages)'=='false'">
12-
<PackageReference Include="Microsoft.Net.Compilers.Toolset" PrivateAssets="All" />
12+
<PackageReference Include="Microsoft.Net.Compilers.Toolset" PrivateAssets="All" GeneratePathProperty="true"/>
1313
<PackageReference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" />
1414
</ItemGroup>
1515

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<Import Project="MSBuild.SDK.SystemWeb.Common.DefaultPackages.props"/>
3+
4+
<PropertyGroup>
5+
<!-- SetRoslynToolPath is true by default unless an explicit RoslynToolPath is already set -->
6+
<SetRoslynToolPath Condition="'$(RoslynToolPath)'!=''">false</SetRoslynToolPath>
7+
<SetRoslynToolPath Condition="'$(SetRoslynToolPath)'==''">true</SetRoslynToolPath>
8+
<!-- This uses the version of Roslyn in Microsoft.Net.Compilers.Toolset to be used in ASP Compilation -->
9+
<!-- Unless SetRoslynToolPath is set to false -->
10+
<!-- Addresses #55 -->
11+
<RoslynToolPath Condition="'$(SetRoslynToolPath)'=='true'">$(PkgMicrosoft_Net_Compilers_Toolset)\tasks\net472</RoslynToolPath>
12+
</PropertyGroup>
313
</Project>

0 commit comments

Comments
 (0)