The idea of solar fences has emerged in places like Europe with a high price of land.
Grid cognition ran some numbers and showed that you can produce more if the fence is two sided and it can be more valuable because an east-west fence will produce more in the morning and evening. They didn’t talk about the cost, but like the idea of using solar cells to clad buildings, there is a bonus if you were going to pay to build a fence anyway.
Here is the idea extended to garden fences: Plug-and-play PV system for garden fences – pv magazine International