File tree 1 file changed +6
-5
lines changed
src/Tasks/Microsoft.NET.Build.Tasks
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 7
7
using System . Linq ;
8
8
using System . Text ;
9
9
using System . Threading . Tasks ;
10
+ using System . Xml . Linq ;
10
11
using Microsoft . Build . Framework ;
11
12
12
13
namespace Microsoft . NET . Build . Tasks
@@ -30,13 +31,13 @@ protected override void ExecuteCore()
30
31
foreach ( var project in ReferencedProjects )
31
32
{
32
33
string nearestTargetFramework = project . GetMetadata ( "NearestTargetFramework" ) ;
33
- int targetFrameworkIndex = project . GetMetadata ( "TargetFrameworks" ) . Split ( ';' ) . ToList ( ) . IndexOf ( nearestTargetFramework ) ;
34
- string projectAdditionalPropertiesMetadata = project . GetMetadata ( "AdditionalPropertiesFromProject" ) . Split ( new [ ] { ";;" } , StringSplitOptions . None ) [ targetFrameworkIndex ] ;
34
+
35
+ var additionalPropertiesXml = XElement . Parse ( project . GetMetadata ( "AdditionalPropertiesFromProject" ) ) ;
36
+ var targetFrameworkElement = additionalPropertiesXml . Element ( nearestTargetFramework ) ;
35
37
Dictionary < string , string > projectAdditionalProperties = new ( StringComparer . OrdinalIgnoreCase ) ;
36
- foreach ( var propAndValue in projectAdditionalPropertiesMetadata . Split ( ';' ) )
38
+ foreach ( var propertyElement in targetFrameworkElement . Elements ( ) )
37
39
{
38
- var split = propAndValue . Split ( '=' ) ;
39
- projectAdditionalProperties [ split [ 0 ] ] = split [ 1 ] ;
40
+ projectAdditionalProperties [ propertyElement . Name . LocalName ] = propertyElement . Value ;
40
41
}
41
42
42
43
var referencedProjectIsExecutable = MSBuildUtilities . ConvertStringToBool ( projectAdditionalProperties [ "_IsExecutable" ] ) ;
You can’t perform that action at this time.
0 commit comments