[18:44:02][Step 5/7] [Core-8] ERROR (Internal): System.InvalidCastException: Unable to cast object of type 'nCrunch.Core.Configuration.GridServerReference' to type 'nCrunch.Core.Configuration.GridServerReference[]'.
[18:44:02][Step 5/7] [Core-8] at nCrunch.Core.Settings.SettingExtensions.Get[TValueType](NonComponentSetting`1 setting)
[18:44:02][Step 5/7] [Core-8] at nCrunch.Client.Grid.GridServerAddressConfiguration.GetGridServerReferences()
[18:44:02][Step 5/7] [Core-8] at nCrunch.Client.Grid.GridClient. ()
[18:44:02]
[Step 5/7] [Core-8] at nCrunch.Client.Grid.GridClient. (EngineEnabledEvent )
Is there a plan to fix this in a foreseeable future?
(It feels awkward having to create a config xml file dynamically just for this setting, in order to support TC build parameters, which also results in another file one needs to take care of cleaning up between builds to avoid undesirable build behavior).
Thanks.
*Edit: Just bumped into same issue that I need CustomEnvironmentVariables as well since grid nodes will not work without it and that is also XML config only, so XML config file is what I will use for now then.
The passing of configuration settings via command line has always been intended to be a lightweight approach to configuring the console tool. This is because some of the configuration settings can be quite hard to specify without tricky syntax, making them error prone. It isn't always easy to have the tool behave in a consistent way if the parameters are specified incorrectly. For example, the CustomEnvironmentVariables and grid addresses are actually composite objects that are held in array form, so trying to represent complex types containing arbitrary strings while held in arrays starts to get a bit crazy.
The general idea of the command line options is to give you an easy way to change a setting or two in simple cases, or if you need to inject something into the engine externally. If you're working with fixed parameters or you have a CI working for a big solution, then you most definitely will need to use a config file.
To follow up with this, it's now possible in the just released v3.18 to provide both the CustomEnvironmentVariables and GridServerReferencesForSolution settings via the command line.
So connecting to a grid node via parameter seems to work :)
But now I have the opposite problem, how do I avoid using grid nodes via command line parameter?
I.e. isn't -GridServerReferencesForSolution meant to override the default values from the global config for the computer? I cannot seem to avoid grid nodes being used if they are set up on the global config for the computer. I tried both
but still NCrunch connects to a grid node configured in my AppData.../globalconfig.crunch.v3.xml
p.s. You might want to have a better error message for scenario where the input format is invalid, like -GridServerReferencesForSolution "Joe" below :) d.s.
ERROR: Configuration setting 'GridServerReferencesForSolution' cannot be overridden using the command line. Try specifying it in a configuration file instead.
When creating the list of all servers that should be connected to, the NCrunch client will take values from both of these settings. This means that if you override just one of them, there can still be values coming from the other. Try overriding both using the command line.
[v3.22]
This bit me again when I thought "Oh well I'll just test it locally with ncrunch.exe"... Is there a recommended way to supply an "empty" parameter for these 2 settings, in order to NOT use any grid nodes at all?
I use below but it feels somewhat hacky.
I don't think we have a clean way to override those settings with nulls at this point in time. Probably if you set them to an empty string, it'll fail to parse or just assume the override is invalid. I'll make a note to see if we can do something about this.