Two relations, the virial relation MADM = MK and the first law in the form δMADM = ΩδJ, should be satisfied by a solution and a sequence of solutions describing binary compact objects in quasiequilibrium circular orbits. Here, MADM, MK, J, and Ω are the ADM mass, Komar mass, angular momentum, and orbital angular velocity, respectively. δ denotes an Eulerian variation. These two conditions restrict the allowed formulations that we may adopt. First, we derive relations between MADM and MK and between δMADM and ΩδJ for general asymptotically flat spacetimes. Then, to obtain solutions that satisfy the virial relation and sequences of solutions that satisfy the first law at least approximately, we propose a formulation for computation of quasiequilibrium binary neutron stars in general relativity. In contrast to previous approaches in which a part of the Einstein equation is solved, in the new formulation, the full Einstein equation is solved with maximal slicing and in a transverse gauge for the conformal three-metric. Helical symmetry is imposed in the near zone, while in the distant zone, a waveless condition is assumed. We expect the solutions obtained in this formulation to be excellent quasiequilibria as well as initial data for numerical simulations of binary neutron star mergers.