What would be the Sref i.e. Reference Wing Area for Drag Build Up Calculation in case of a box wing design? Would Sref be sum of areas of both, the front and the back wing? or just one wing? Assuming both the wings have equal areas (image below)
Details - So, I am calculating drag using the component drag build up method and using the below equation for the following parts of my box wing design.

Front Wing
Aft Wing
Fuselage
Tail

as you can see in the equation below, Swet for all different parts are divided by &quot;Sref&quot;. For example assuming that both wings have area of 10m^2 and therefore wetted area of roughly about 20m^2 each.
for Cd0 calculation what should use as my Sref? total lift generating area of the aircraft, as in 10+10=20? or just the area of any one wing, 10?
If I use 20, for example, and apply the below formula for the front wing, my (Swet/Sref = 1) whereas it's = 2 if I use, Sref as 10m^2?
Basically, my total CD0 values changes drastically as I change my Sref according to the below equation, why is that?
You could argue for one or for both, but ultimately, it doesn't matter - as long as you are consistent and use the same reference area throughout your calculation/analysis.
If I personally were to choose, I would go for both, on the basis of total lifting area.
EDIT for details ------
Well yet again, it doesn't matter. You will get some value for your $C_{Dmin}$. Then later for other calculations you will use the same $S_{ref}$ and you will get comparable drag coefficients. Finally, when you use $D_{total} \text{ [N]} = C_{D} \cdot 0.5 \cdot \rho \cdot v^2 \cdot S_{ref}$ you will input same $S_{ref}$ and you will get the same Newtons regardless of chosen $S_{ref}$.
What matters is that you're consistent, i.e. if you use $S_{ref} = 10 \text{ m}^2$, use that for everything. If you use $S_{ref} = 20 \text{ m}^2$, use that for everything.
Additionally, do recheck the wetted area argument. $S_{wet} \neq S_{ref}$, because $S_{wet}$ includes both upper and lower surface of each wing, whereas $S_{ref}$ includes only the planform surface.