[英]Service Fabric and IConfigurationBuilder
I'm trying to use IConfigurationBuilder for purses of reading xml configuration. 我正在尝试使用IConfigurationBuilder来读取xml配置。 However when the service runs (once deployed) it fails at this line: 但是,当服务运行(一旦部署)时,它将在以下行失败:
private static void Main()
{
try
{
IConfigurationBuilder Builder = new ConfigurationBuilder(); // Exception here
..
ServiceRuntime.RegisterServiceAsync("MyService.ServiceType",
context => new Service(
context)
.GetAwaiter().GetResult();
On the server I see this exception in Application Logs: 在服务器上,我在应用程序日志中看到此异常:
Description: The process was terminated due to an unhandled exception. 说明:由于未处理的异常,进程已终止。 Exception Info: System.IO.FileNotFoundException at MyService.Program.Main() 异常信息:MyService.Program.Main()上的System.IO.FileNotFoundException
If I remove this line it works fine. 如果我删除此行,它将正常工作。
And it does WORK fine when I run the service locally from VS. 当我从VS本地运行服务时,它确实工作正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.