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]
Or
田中さんのうちで赤ちゃんが生まれた。
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 than 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.)