Skip to content

Commit

Permalink
Always use Path.Combine when building fully qualified file names. Fix…
Browse files Browse the repository at this point in the history
… for issue #1378.
  • Loading branch information
mistachkin authored and ajcvickers committed Oct 21, 2019
1 parent 85c06a1 commit dbdfb88
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Microsoft.Data.Entity.Build.Tasks/EntityDeploy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,29 +207,29 @@ private bool OutputCMS(string inputFileRelativePath, DirectoryInfo topLevelOutpu
outputDir.Create();
}

string outputDirPath = outputDir.FullName + "\\";
string outputDirPath = outputDir.FullName;
string outputFileNamePrefix = outputFile.Name.Replace(XmlConstants.EdmxFileExtension, String.Empty);
string csdlFileName = outputFileNamePrefix + XmlConstants.CSpaceSchemaExtension;
string mslFileName = outputFileNamePrefix + XmlConstants.CSSpaceSchemaExtension;
string ssdlFileName = outputFileNamePrefix + XmlConstants.SSpaceSchemaExtension;

bool csdlProducedSuccessfully = OutputXml(outputDirPath + csdlFileName, conceptualSchemaElement);
bool mslProducedSuccessfully = OutputXml(outputDirPath + mslFileName, mappingElement);
bool ssdlProducedSuccessfully = OutputXml(outputDirPath + ssdlFileName, storageSchemaElement);
bool csdlProducedSuccessfully = OutputXml(Path.Combine(outputDirPath, csdlFileName), conceptualSchemaElement);
bool mslProducedSuccessfully = OutputXml(Path.Combine(outputDirPath, mslFileName), mappingElement);
bool ssdlProducedSuccessfully = OutputXml(Path.Combine(outputDirPath, ssdlFileName), storageSchemaElement);

if (csdlProducedSuccessfully)
{
_newResources.Add(CreateTaskItem(outputDirPath + csdlFileName, csdlFileName, inputFileRelativePath));
_newResources.Add(CreateTaskItem(Path.Combine(outputDirPath, csdlFileName), csdlFileName, inputFileRelativePath));
}

if (ssdlProducedSuccessfully)
{
_newResources.Add(CreateTaskItem(outputDirPath + ssdlFileName, ssdlFileName, inputFileRelativePath));
_newResources.Add(CreateTaskItem(Path.Combine(outputDirPath, ssdlFileName), ssdlFileName, inputFileRelativePath));
}

if (mslProducedSuccessfully)
{
_newResources.Add(CreateTaskItem(outputDirPath + mslFileName, mslFileName, inputFileRelativePath));
_newResources.Add(CreateTaskItem(Path.Combine(outputDirPath, mslFileName), mslFileName, inputFileRelativePath));
}

return (csdlProducedSuccessfully && mslProducedSuccessfully && ssdlProducedSuccessfully);
Expand Down

0 comments on commit dbdfb88

Please sign in to comment.