Skip to content
Permalink
Browse files

[Assets] Make sure solution/project path use backslashes

  • Loading branch information
xen2 committed Dec 13, 2018
1 parent 88669a5 commit f6fdfa550d3eed3c12a13874fa9fa616eda5e22f
@@ -604,7 +604,7 @@ public static PackageContainer LoadProject(ILogger log, string filePath)

// Find the .csproj next to .xkpkg (if any)
// Note that we use package.FullPath since we must first perform package upgrade from 3.0 to 3.1+ (might move package in .csproj folder)
var projectPath = Path.ChangeExtension(package.FullPath, ".csproj");
var projectPath = Path.ChangeExtension(package.FullPath.ToWindowsPath(), ".csproj");
if (File.Exists(projectPath))
{
return new SolutionProject(package, Guid.NewGuid(), projectPath);
@@ -368,7 +368,7 @@ public string GetRelativePath(Solution solution)
{
if (TypeGuid == KnownProjectTypeGuid.SolutionFolder)
return FullPath;
return Uri.UnescapeDataString(new Uri(solution.FullPath, UriKind.Absolute).MakeRelativeUri(new Uri(FullPath, UriKind.Absolute)).ToString());
return Uri.UnescapeDataString(new Uri(solution.FullPath, UriKind.Absolute).MakeRelativeUri(new Uri(FullPath, UriKind.Absolute)).ToString()).Replace('/', '\\');
}

/// <summary>
@@ -80,7 +80,7 @@ protected override bool Generate(SessionTemplateGeneratorParameters parameters)
// Setting this to true will enforce all package dependencies to be moved to a folder local to the project
bool doMoveParentDependencies = true;

var packageFile = Path.ChangeExtension(description.FullPath, Package.PackageFileExtension);
var packageFile = Path.ChangeExtension(description.FullPath.ToWindowsPath(), Package.PackageFileExtension);

if (!File.Exists(packageFile))
{
@@ -92,7 +92,7 @@ public static void LoadDefaultTemplates()
{
var logger = new LoggerResult();
var packageFile = PackageStore.Instance.GetPackageFileName(packageInfo.Name, new PackageVersionRange(new PackageVersion(packageInfo.Version)));
var package = Package.Load(logger, packageFile);
var package = Package.Load(logger, packageFile.ToWindowsPath());
if (logger.HasErrors)
throw new InvalidOperationException($"Could not load package {packageInfo.Name}:{Environment.NewLine}{logger.ToText()}");

0 comments on commit f6fdfa5

Please sign in to comment.
You can’t perform that action at this time.