This is a supplementary answer to compliment Chocolate's answer, written to meet the OP's request for technical reference.
に vs で is covered in "A Students' guide to Japanese Grammar" by Naomi McGloin on p62.
As Chocolate indicates and this book explains: で marks the location of action, に marks the location of existence.
1) Some verbs characteristically take に、eg 住む、立つ、かける：
Please sit on the chair
2) Some verbs take either に or で but the meaning changes:
It is in my house.
It will be held at my house. [ie an event, perhaps a party]
The baby was born at the Tanaka's house.
A baby was born to the Tanaka family.
In this example, if we use で then the baby was not necessarily the Tanakas', if we use に then the baby was not necessarily born at the Tanaka's house.
Another example, somewhat similar to yours is:
I made the shelves in the room.
I made shelves for the room.
(BTW, it is worth noting that some textbooks give different explanations which work quite well for their target students at the time but can over simplify. に has far more uses that just a "standard usage" exemplified by いる／ある and a role as a "target particle" . Based on your final comment you seem to understand this but for reference, The Dictionary of Basic Japanese Grammar by Makino gives seven uses and still does not answer all my questions on the particle.)