According to the present disclosure, a bioadhesive formulation is provided. The bioadhesive formulation comprises a polycaprolactone dendrimer having a dendrimer core and a plurality of polycaprolactone chains extending from the dendrimer core, wherein at least one of the polycaprolactone chains has an end which is covalently attached with a diazirine, and wherein the diazirine converts to a carbene or a diazoalkyl when a stimulant is applied to the bioadhesive formulation. Methods of forming the bioadhesive formulation are also provided. The bioadhesive could be used in (i) the prevention of thrombosis from tissue fixation and/or (ii) the relief of discomfort and/or pain during and/or after surgery. Preferably, the bioadhesive formulation further comprises a hygroscopic additive, an antithrombotic agent, and/or an anaesthetic agent.