Question

What .NET method does OpenSpan.Runtime.RuntimeHost.GetDeploymentPackagePath() call under the covers?

We are creating a method in a class library that could be called from Pega solutions, as well as .NET solutions. The goal is to be able to determine the directory where deployment files are located. With a .NET solution, that could be done with

System.Reflection.Assembly.GetExecutingAssembly().Location

However, that won't work properly when the class is used by an OpenSpan/Pega solution, as it would return the OpenSpan installation directory. Inside an OpenSpan solution, we could use

OpenSpan.Runtime.RuntimeHost.GetDeploymentPackagePath()

... to get the correct folder. However, we don't want to use OpenSpan assembly references inside the our class library. Does GetDeploymentPackagePath use an underlying .NET Framework class method under the covers, in a manner of speaking?

Comments

Keep up to date on this post and subscribe to comments

Pega
September 27, 2019 - 10:23pm

It seems like the Deployment path and the executing assembly location are looking for two different things. This might start pointing you towards the right path, though I'm not certain what .NET is going to refer to an OpenSpan/Pega deployment as.

https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-list-reference

October 7, 2019 - 9:54am
Response to grona

Thanks for the reply. I don't think this would work for us, as the class library in question is not referencing other projects. 

Yes, the deployment path and the executing assembly location are definitely looking for two different things. Was hoping to gain some insight at what underlying .NET class method(s) are being used under the covers for OpenSpan's GetDeploymentPackagePath method. Maybe we could reproduce and use that code directly, even if it took several lines.