Skip to content

Commit

Permalink
Remove System.Configuration usage for .NET Core
Browse files Browse the repository at this point in the history
  • Loading branch information
dsplaisted committed Aug 21, 2015
1 parent 9987c90 commit 5fe2447
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
<DefineConstants>$(DefineConstants);FEATURE_SPECIAL_FOLDERS</DefineConstants>
<FeatureSpecialFolders>true</FeatureSpecialFolders>
<DefineConstants>$(DefineConstants);FEATURE_SYSTEM_CONFIGURATION</DefineConstants>
<FeatureSystemConfiguration>true</FeatureSystemConfiguration>
<DefineConstants>$(DefineConstants);FEATURE_THREAD_ABORT</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_THREAD_CULTURE</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_THREAD_PRIORITY</DefineConstants>
Expand Down
2 changes: 2 additions & 0 deletions src/Shared/FrameworkLocationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
using Microsoft.Build.Evaluation;
using Microsoft.Win32;

#if FEATURE_SYSTEM_CONFIGURATION
using PropertyElement = Microsoft.Build.Evaluation.ToolsetElement.PropertyElement;
#endif
using System.Reflection;
using System.Runtime.InteropServices;

Expand Down
10 changes: 9 additions & 1 deletion src/XMakeBuildEngine/Definition/ToolsetReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ internal abstract class ToolsetReader
/// </summary>
internal static string ReadAllToolsets(Dictionary<string, Toolset> toolsets, PropertyDictionary<ProjectPropertyInstance> environmentProperties, PropertyDictionary<ProjectPropertyInstance> globalProperties, ToolsetDefinitionLocations locations)
{
return ReadAllToolsets(toolsets, null, null, environmentProperties, globalProperties, locations);
return ReadAllToolsets(toolsets, null,
#if FEATURE_SYSTEM_CONFIGURATION
null,
#endif
environmentProperties, globalProperties, locations);
}

/// <summary>
Expand All @@ -99,7 +103,9 @@ internal static string ReadAllToolsets
(
Dictionary<string, Toolset> toolsets,
ToolsetRegistryReader registryReader,
#if FEATURE_SYSTEM_CONFIGURATION
ToolsetConfigurationReader configurationReader,
#endif
PropertyDictionary<ProjectPropertyInstance> environmentProperties,
PropertyDictionary<ProjectPropertyInstance> globalProperties,
ToolsetDefinitionLocations locations
Expand All @@ -116,6 +122,7 @@ ToolsetDefinitionLocations locations
string overrideTasksPathFromConfiguration = null;
string defaultOverrideToolsVersionFromConfiguration = null;

#if FEATURE_SYSTEM_CONFIGURATION
if ((locations & ToolsetDefinitionLocations.ConfigurationFile)
== ToolsetDefinitionLocations.ConfigurationFile)
{
Expand All @@ -139,6 +146,7 @@ ToolsetDefinitionLocations locations
out defaultOverrideToolsVersionFromConfiguration);
}
}
#endif

string defaultToolsVersionFromRegistry = null;
string overrideTasksPathFromRegistry = null;
Expand Down
4 changes: 2 additions & 2 deletions src/XMakeBuildEngine/Microsoft.Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@
<Compile Include="Definition\ResolvedImport.cs" />
<Compile Include="Definition\SubToolset.cs" />
<Compile Include="Definition\Toolset.cs" />
<Compile Include="Definition\ToolsetConfigurationReader.cs" />
<Compile Include="..\Shared\ToolsetElement.cs">
<Compile Include="Definition\ToolsetConfigurationReader.cs" Condition="$(FeatureSystemConfiguration) == 'true'"/>
<Compile Include="..\Shared\ToolsetElement.cs" Condition="$(FeatureSystemConfiguration) == 'true'">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Definition\ToolsetPropertyDefinition.cs" />
Expand Down

0 comments on commit 5fe2447

Please sign in to comment.