Skip to content

Commit 7c6ccf1

Browse files
authored
修复 单文件发布-p:EnableCompressionInSingleFile=true 不能获取工作路径 (#29)
Fix working directory error for single exe applications
1 parent 506a2f6 commit 7c6ccf1

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/SharpWebview/Content/HostedContent.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ public Startup(StartupParameters startupParameters)
4848
public void ConfigureServices(IServiceCollection services) { }
4949
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
5050
{
51-
var workingDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
5251
var fileServerOptions = new FileServerOptions
5352
{
54-
FileProvider = new PhysicalFileProvider(Path.Combine(workingDirectory, "app")),
53+
FileProvider = new PhysicalFileProvider(Path.Combine(System.Environment.CurrentDirectory, "app")),
5554
RequestPath = "",
5655
EnableDirectoryBrowsing = true,
5756
};
@@ -65,4 +64,4 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
6564
app.UseFileServer(fileServerOptions);
6665
}
6766
}
68-
}
67+
}

0 commit comments

Comments
 (0)