I think one needs to see the previous sentence, as そのようにして perhaps refers to the state of the 巨城 that is not made clear from the information at hand.
adjectival noun → conjugation:
that kind of; of the sort; of the kind; such
そのようにして is a pretty common construction, sometimes translated as simply as just "So,...".
I will break it down literally for you:
そのよう that way にして was done
Put together it can be read as, "In that way..."
(して in the middle of the sentence is expressing the past tense of する, in accordance with the されてきた at the end of the sentence)
My attempt at translation:
In the state it was/In this way/In this state 巨城 was slowly captured over the course of two long years .
I think the よう is this one:
形 · 容：form; shape; figure
rather than this one:
But perhaps someone better informed can tell us?
Here are a number of examples if the expression you asked about:
(copy and paste whole link)