Skip to content

Commit

Permalink
Merge pull request #609 from razzmatazz/fix-csproj-loading-without-so…
Browse files Browse the repository at this point in the history
…me-properties

OmniSharp.MSBuild: fix .csproj loading when some props are missing
  • Loading branch information
DustinCampbell authored Jul 18, 2016
2 parents 2798d5b + bd70931 commit 9b7a207
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,18 +289,28 @@ public static ProjectFileInfo Create(
projectFileInfo.DefineConstants = defineConstants.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToList();
}

var signAssembly = properties["SignAssembly"].FinalValue;
if (!string.IsNullOrWhiteSpace(signAssembly))
if (properties.ContainsKey("SignAssembly"))
{
projectFileInfo.SignAssembly = Convert.ToBoolean(signAssembly);
var signAssembly = properties["SignAssembly"].FinalValue;

if (!string.IsNullOrWhiteSpace(signAssembly))
{
projectFileInfo.SignAssembly = Convert.ToBoolean(signAssembly);
}
}

projectFileInfo.AssemblyOriginatorKeyFile = properties["AssemblyOriginatorKeyFile"].FinalValue;
if (properties.ContainsKey("AssemblyOriginatorKeyFile"))
{
projectFileInfo.AssemblyOriginatorKeyFile = properties["AssemblyOriginatorKeyFile"].FinalValue;
}

var documentationFile = properties["DocumentationFile"].FinalValue;
if (!string.IsNullOrWhiteSpace(documentationFile))
if (properties.ContainsKey("DocumentationFile"))
{
projectFileInfo.GenerateXmlDocumentation = true;
var documentationFile = properties["DocumentationFile"].FinalValue;
if (!string.IsNullOrWhiteSpace(documentationFile))
{
projectFileInfo.GenerateXmlDocumentation = true;
}
}
#endif
}
Expand Down

0 comments on commit 9b7a207

Please sign in to comment.