Answer the question
In order to leave comments, you need to log in
How to include a library in Powershell so that it uses its own config file?
Hello,
I can’t understand how you can connect the library to the script so that it uses its own config file.
There is this code:
$FBToolsShare = "<path_to_share>"
Import-Module($(Join-Path $FBToolsShare -ChildPath "<dll_name>"))
[appdomain]::CurrentDomain.SetData("APP_CONFIG_FILE", $(Join-Path $FBToolsShare -ChildPath "<dll_name>.config"))
$CRMClient = New-Object CRMServiceClient -ArgumentList "<name_endpoint>"
New-Object : Exception calling ".ctor" with "1" argument(s): "Could not find endpoint element with name '<name_endpoint>' and contract '<name_contract>' in the ServiceModel client
configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element."
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question