Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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

    Scheduled Pinned Locked Moved Support
    iisbuildmaster
    6 Posts 2 Posters 13 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jstarbird_7831
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • J Offline
          jstarbird_7831
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • J Offline
              jstarbird_7831
              last edited by

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

              1 Reply Last reply Reply Quote 0
              • ? This user is from outside of this forum
                Guest
                last edited by

                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.

                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • 1 / 1
                • First post
                  Last post
                Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation