Polymeric carbon nitride (p-CN) has attracted increasing interest as a metal-free photocatalyst in energy conversion and bacterial disinfection. However, due to its particulate and insoluble nature, compounding p-CN at the molecular level into a functional composite of high performance remains a grand challenge. Here, we report the dissolution of p-CN in polyphosphoric acid (PPA) and the homogeneous compounding with carbon nanotubes (CNTs) into a free-standing film simply by co-dissolution, precipitation, and filtration. Interestingly, the as-prepared p-CN-CNTs film exhibited superior film strength than the pristine CNTs and nearly complete inactivation of E. coli and S. aureus under simulated solar irradiation with superoxide radicals as the dominant intermediates. Mechanistic studies indicated that the acidity and viscosity of PPA play crucial roles in the dissolution. The universality of this finding was supported by the further successful discovery of a new type of solvent for p-CN using task-specific ionic liquids. This work would provide a general way to address the dissolution difficulties of p-CN, and pave the prospective application of p-CN in nanocomposites at the molecular level.