Hello,

After refactoring my code, I have encountered the following error message:

Internal Error
Invalid compiler output.
Unable to cast object of type 'OutSystems.HubEdition.Compiler.Expressions.FieldIdentifier' to type 'OutSystems.HubEdition.Compiler.Optimizer.IIdentifierExpression'.
Exception Details:
[1] System.InvalidCastException: Unable to cast object of type 'OutSystems.HubEdition.Compiler.Expressions.FieldIdentifier' to type 'OutSystems.HubEdition.Compiler.Optimizer.IIdentifierExpression'.
   at OutSystems.HubEdition.Compiler.Nodes.Assign.collectUsage(OptimizerNodeUsage usage, Int32 assignIndex)
   at OutSystems.HubEdition.Compiler.Optimizer.OptimizerNodes.ActionsNodes.OptimizerAssignActionNode.CalculateUsage()
   at OutSystems.HubEdition.Compiler.Optimizer.OptimizerUtils.removeEmptyNodes(IOptimizableGraph graph)
   at OutSystems.HubEdition.Compiler.Optimizer.ViewState.NodeViewState..ctor(IServerScreenFlowNode screen)
   at OutSystems.HubEdition.Compiler.Interfaces.ServerScreenFlowNodeUtils.DefaultOptimize(IServerScreenFlowNode screenFlowNode, NodeViewState& viewState)
   at OutSystems.HubEdition.Compiler.Flows.WebFlow.Optimize()
   at OutSystems.HubEdition.Compiler.WebFlows.WebHandler.Dump(IEnumerable`1 webFlows)
   at OutSystems.HubEdition.Compiler.ESpace.Dump()
   at OutSystems.HubEdition.Compiler.Compiler.DumpEspaceCode(ESpace eSpace, CompilationContext context)
   at OutSystems.HubEdition.Compiler.Compiler.InnerGenerateCode(ESpace eSpace, CompilationContext context, Nullable`1 isIsolatedInServer)
   at OutSystems.HubEdition.Compiler.Utils.CompilerUtils.TrapExceptionsInContext(Action action, CompilationContext context)


According to previous posts, this was fixed when closing then reopening the application, but that didn't work for me. Everytime I try to publish I get the error.

Thanks,


Hi Daniel,


If you try to publish a previous version of your code (before the refactoring) via Service Center, do you have the same error?

Try to restart both the OutSystems Deployment Controller Service and the OutSystems Deployment Service in the server and publish again.


Rui Barradas