【发布时间】:2018-08-02 20:06:14
【问题描述】:
我正在尝试使用 IConfigurationBuilder 来读取 xml 配置。但是,当服务运行时(一旦部署),它会在这一行失败:
private static void Main()
{
try
{
IConfigurationBuilder Builder = new ConfigurationBuilder(); // Exception here
..
ServiceRuntime.RegisterServiceAsync("MyService.ServiceType",
context => new Service(
context)
.GetAwaiter().GetResult();
在服务器上,我在应用程序日志中看到此异常:
描述:进程因未处理的异常而终止。 异常信息:System.IO.FileNotFoundException 在 MyService.Program.Main()
如果我删除此行,它会正常工作。
当我从 VS 本地运行服务时,它确实可以正常工作。
【问题讨论】:
-
xml 文件是否作为应用程序包的一部分部署到集群? henidak.com/2015/07/blog
标签: c# .net azure-service-fabric