Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Issue using EnsureAppPool



  • When trying to use Ensure-AppPool and using variables for the properties.
    The problem I'm having is that the Ensure-AppPool has some properties that are required to be certain types, TimeSpan, Int, etc. so when I try to use it, it fails.
    I could not find any documentation about declaring variable types in Otterscript, is there some way to do this? If so can I also do it in the Template area where you can set the Required parameters?

    Thanks

    Product: BuildMaster
    Version: 5.3.6



  • The Strings & Values section in the reference goes into a bit more detail, but there are no types; effectively, everything is a string value.

    As long as the end values can be coerced/converted to the expected type, it should be fine...

    set $thousand = 1000;
    IIS::Ensure-AppPool hdars
    (
        Enable32BitAppOnWin64: true,
        QueueLength: $thousand
    );
    

    ... of course, if you were to have $thousand be thousand then it would obviously throw an error, because thousand is not an integer.



  • Well I'm using variables set in the Application/Settings/Template Variables section and they are numbers but I get this error:

        Unhandled exception: System.InvalidCastException: Invalid cast from 'System.String' to 'System.TimeSpan'.
       at System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider)
       at Inedo.BuildMaster.PlanExecuter.ScriptPropertyMapper.CoerceValue(RuntimeValue value, Type type)
       at Inedo.BuildMaster.PlanExecuter.ScriptPropertyMapper.SetPropertyValue(Object target, IVariableEvaluationContext variableContext, String propertyValue, PropertyInfo property)
       at Inedo.BuildMaster.PlanExecuter.ScriptPropertyMapper.SetProperties(Object target, ActionStatement action, IVariableEvaluationContext variableContext)
       at Inedo.BuildMaster.Windows.ServiceApplication.Executions.PlanExecuter.DeploymentPlanExecuter.<Inedo-ExecutionEngine-Executer-IExecutionHostEnvironment-ExecuteActionAsync>d__21.MoveNext()
    

    I've actually got the one field that requires a timespan set to 0 in the variable I'm passing to it.



  • Ah; ok. This is a known bug (TimeSpan Values are not Propery Coerced) that was fixed in Otter but not brought over to BuildMaster; it will be fixed in next maintenace release as [BM-2209].

    It only impacts TimeSpan-based properties.



  • Any way to do it in the meantime? And any ETA on that particular release?
    Just have a deployment I need to do.



  • It's scheduled for release later today.

    in the mean time, you can use PowerShell or not set that particular property that requires a timespan.



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation