Resolution for "The path must be absolute" on published projects

Trying to replace the internal "." folder with the local assembly path in order to have an absolute path for the PhysicalFileStorage class at startup ("The path must be absolute" error at startup for published projects)

May resolve the issue of #376 on dev
This commit is contained in:
Guillaume ZAHRA 2018-04-03 18:11:20 +02:00 committed by Steve Sanderson
parent 049673db0d
commit 3b0f1313fe
1 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,11 @@ namespace Microsoft.AspNetCore.Blazor.Server
var configLines = File.ReadLines(configFilePath).ToList();
SourceMSBuildPath = configLines[0];
if (SourceMSBuildPath == ".")
{
SourceMSBuildPath = assemblyPath;
}
var sourceMsBuildDir = Path.GetDirectoryName(SourceMSBuildPath);
SourceOutputAssemblyPath = Path.Combine(sourceMsBuildDir, configLines[1]);