lap*_*sus 6 azure-service-fabric
在我的代码中,我失败了
if (!File.Exists(_configurationFileName)) {...}
Run Code Online (Sandbox Code Playgroud)
在即时窗口中,我打了一个电话Directory.GetCurrentDirectory(),它指向我的" 工作 "文件夹,而不是我期望的" 代码 "文件夹.
Directory.GetCurrentDirectory()
"C:\\SfDevCluster\\Data\\_App\\_Node_0\\My.Application.Type_App2\\work"
Run Code Online (Sandbox Code Playgroud)
所以当然没有找到位于可执行文件旁边的配置文件.
现在我想知道解决方案是什么.
由于我还想继续运行控制台应用程序,我不想实现任何"if service fabric hosting,然后更改当前目录,..."解决方法.
有什么建议?我的.exe.config文件怎么样(如果有的话,怎么会找到它们)?
Service Fabric将当前目录设置为"工作"的原因是什么?这是某种安全机制吗?
use*_*062 11
这就是我刚刚更改服务清单以指向代码的方式
<EntryPoint>
<ExeHost>
<Program>configui.exe</Program>
<WorkingFolder>CodePackage</WorkingFolder>
</ExeHost>
</EntryPoint>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3119 次 |
| 最近记录: |