Pastoral plays were a common genre during the Renaissance period. They idealized country life and presented this world as almost Edenic in its innocence. As such, these stories were less interested in presenting the actual hard work of rural life and more intent on providing a sense of escape from the hustle and bustle of cities. Shakespeare had pastoral elements in a few of his plays, such as The Two Gentlemen of Verona and The Winter's Tale, but As You Like It is his fullest exploration of this once-prominent genre.
The setting of the Forest of Arden is entirely pastoral, a space populated by shepherds and displaced courtiers on the run. It is contrasted with the corrupt, artificial world of the court, where Rosalind finds herself endangered. In Arden, nature becomes a healing force, allowing Rosalind and Orlando to form a relationship and bringing the villainous Duke Ferdinand to his senses.
It must be noted that Shakespeare does complicate his presentation of country life by pointing out that such a life is not always easy. In act 2, scene 1, Duke Senior is just as apt to point out that nature can make life away from the controlled setting of the court difficult:
Now, my co-mates and brothers in exile,
Hath not old custom made this life more sweet
Than that of painted pomp? Are not these woods
More free from peril than the envious court?
Here feel we but the penalty of Adam,
The seasons' difference, as the icy fang
And churlish chiding of the winter's wind,
Which, when it bites and blows upon my body,
Even till I shrink with cold, I smile and say
"This is no flattery: these are counsellors
That feelingly persuade me what I am."
Sweet are the uses of adversity,
Which, like the toad, ugly and venomous,
Wears yet a precious jewel in his head;
And this our life exempt from public haunt
Finds tongues in trees, books in the running brooks,
Sermons in stones and good in every thing.
I would not change it.
Despite this harshness, Duke Senior still feels rural life is preferable to city life. Other little jabs at the pastoral such as this are present in As You Like It, but overall, the story tends to play its pastoral tropes straight.