The correct option is
B was trying
The given sentence is in the past tense and hence we must fill in the blank with the past tense too. The sentence describes the situation when the action was happening or took place in the past and as the action hasn't ended, we must use the continuous tense.
Option A - 'Did try' can't be used here, as we use 'did' to reaffirm that the action is completed in the past. However, as explained above, the action hasn't been completed (because the sentence uses an infinitive verb - to get). It means that the action of getting a job was going on and wasn't yet completed. Thus option A is incorrect.
Option C - 'Would try' is used in the conditional sentences or in the future tense. 'Would' indicates possibility. Thus option C is incorrect.
Option D - 'Have tried' is used in the present perfect tense. Thus option D is incorrect.
Option E - 'Shall try' is used in the simple future tense. Thus option E is incorrect.
Option B - 'Was trying' can be used to explain the sentence in the past continuous tense. Thus option B is the correct answer.
'I didn't know anyone in the city where I was trying to get a job.'