Gurobi.GRBException: Name too long
Especially when enabling UniqueLongNames for your model, you might encounter the following exception, when using the Gurobi solver:
Exception thrown: 'Gurobi.GRBException' in gurobi81.netstandard20.dll
[2019-08-07 07:21:29.688] [Critical] Exception occured: Name too long (maximum name length is 255 characters) at gurobi81.netstandard20:
Gurobi.GRBException: Name too long (maximum name length is 255 characters)
To prevent this, you can limit the length of the generated long names by setting the scope Configuration.MaximumNameLength to a value of 255
or lower.
The names that are generated by the DebugNameGenerators
that you can configure for your VariableCollections (etc.), will be truncated so that the name in combination with the base64 suffix (for uniqueness) will not exceed the Configuration.MaximumNameLength.