Browse Source

Fixed bug that caused MSBuild item metadata values to always be escaped on project creation.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@5983 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Daniel Grunwald 16 years ago
parent
commit
b13831f676
  1. 11
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs

11
src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs

@ -320,10 +320,13 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -320,10 +320,13 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
StringParser.Parse(projectItem.Include)
);
foreach (string metadataName in projectItem.MetadataNames) {
newProjectItem.SetEvaluatedMetadata(
StringParser.Parse(metadataName),
StringParser.Parse(projectItem.GetMetadata(metadataName))
);
string metadataValue = projectItem.GetMetadata(metadataName);
// if the input contains any special MSBuild sequences, don't escape the value
// we want to escape only when the special characters are introduced by the StringParser.Parse replacement
if (metadataValue.Contains("$(") || metadataValue.Contains("%"))
newProjectItem.SetMetadata(StringParser.Parse(metadataName), StringParser.Parse(metadataValue));
else
newProjectItem.SetEvaluatedMetadata(StringParser.Parse(metadataName), StringParser.Parse(metadataValue));
}
((IProjectItemListProvider)project).AddProjectItem(newProjectItem);
}

Loading…
Cancel
Save