Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/273.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在ServiceFabric中获取数据包的路径?_C#_Deployment_Azure Service Fabric - Fatal编程技术网

C# 如何在ServiceFabric中获取数据包的路径?

C# 如何在ServiceFabric中获取数据包的路径?,c#,deployment,azure-service-fabric,C#,Deployment,Azure Service Fabric,我在SF服务的PackageRoot下创建了一个数据包(称为webvc),其中包含一个License.xml文件,如下所示: ApplicationTypePackageRoot -->WebSvcPkg -->资料 -->License.xml 现在在我的C代码中,我想获得License.xml文件的完整路径。如何执行此操作?您似乎可以通过服务的CodePackageActivationContext找到路径: var dataPackage = this.serviceContext.Co

我在SF服务的PackageRoot下创建了一个数据包(称为
webvc
),其中包含一个License.xml文件,如下所示:

ApplicationTypePackageRoot -->WebSvcPkg -->资料 -->License.xml


现在在我的C代码中,我想获得License.xml文件的完整路径。如何执行此操作?

您似乎可以通过服务的
CodePackageActivationContext
找到路径:

 var dataPackage = this.serviceContext.CodePackageActivationContext.GetDataPackageObject("Data");
 var nsbLicensePath = Path.Combine(dataPackage.Path, "License.xml");

是的,这就是方法。如何获得来宾可执行文件的路径?