</When>
</Choose>
+ <!-- Enable the SkipLocalsInit feature for any source project that is part of the .NETCoreApp shared framework. -->
<PropertyGroup>
- <SkipLocalsInit Condition="'$(SkipLocalsInit)' == '' and '$(MSBuildProjectExtension)' == '.csproj' and '$(IsNETCoreAppSrc)' == 'true' and ($([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '$(NetCoreAppCurrent)')))">true</SkipLocalsInit>
+ <SkipLocalsInit Condition="'$(SkipLocalsInit)' == '' and '$(MSBuildProjectExtension)' == '.csproj' and '$(IsNETCoreAppSrc)' == 'true' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp'">true</SkipLocalsInit>
</PropertyGroup>
<!--Instructs compiler not to emit .locals init, using SkipLocalsInitAttribute.-->
<PropertyGroup >
<!-- This is needed to use the SkipLocalsInitAttribute. -->
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <IncludeSkipLocalsInitAttribute Condition="'$(IncludeSkipLocalsInitAttribute)' == '' and $([MSBuild]::VersionLessThan($(TargetFrameworkVersion), '5.0'))">true</IncludeSkipLocalsInitAttribute>
</PropertyGroup>
<ItemGroup>
+ <Compile Include="$(CoreLibSharedDir)System\Runtime\CompilerServices\SkipLocalsInitAttribute.cs" Link="System\Runtime\CompilerServices\SkipLocalsInitAttribute.cs" Condition="'$(IncludeSkipLocalsInitAttribute)' == 'true'" />
<Compile Include="$(CommonPath)SkipLocalsInit.cs" Link="Common\SkipLocalsInit.cs" />
</ItemGroup>
</When>
| AttributeTargets.Method
| AttributeTargets.Property
| AttributeTargets.Event, Inherited = false)]
- public sealed class SkipLocalsInitAttribute : Attribute
+#if SYSTEM_PRIVATE_CORELIB
+ public
+#else
+ internal
+#endif
+ sealed class SkipLocalsInitAttribute : Attribute
{
public SkipLocalsInitAttribute()
{