Hi, I am trying to add a stack reference, but keep...
# azure
f
Hi, I am trying to add a stack reference, but keep encountering this error:
registered twice (read and read)
. Does anyone know how to fix this? Example code:
Copy code
var stackNames = new List<string> { "stack1", "stack2" };
            
            var backendPools = stackNames.Select(stack =>
            {
                var stackRef = new StackReference($"{stack}ref", new StackReferenceArgs { Name = $"company/project/{stack}" });

                var output1 = stackRef.RequireOutput("output1").Apply(_ => _.ToString());
                var output2 = stackRef.RequireOutput("output2").Apply(_ => _.ToString());

                return GetBackendPoolArgs(..);
            });
ah, got my
name
param mixed up with the stack name. All good now!
actually, that wasn't it after all. Still need help on this please.
t
Why do you have
stack1
two times?
They conflict with each other
f
bad example, sorry
in my code, the names are different. I've updated the example - do you know what would throw that error?
t
I’d still guess two stack references with the same name somehow…