Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always use Path.Combine when building fully qualified file names. Fix for issue #1378. #1385

Merged
merged 1 commit into from
Oct 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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