Hansiz was born in the town of Volkermarkt in the Duchy of Carinthia in a Carinthian Slovene family. He was only fifteen when he entered the Society of Jesus in the near town of Eberndorf. He was ordained a priest in 1708 and on the completion of his studies became professor of humanities at Vienna. From 1713 to 1717 he taught philosophy at Graz, and from 1717 devoted himself entirely to the study of history.
His interest in the Anglia Sacra of Henry Wharton, the Gallia Christiana of Sainte-Marthe, Ughelli's Italia Sacra, and other similar treatises, together with the advice of the scholarly librarian, Bernardo Gentilotti, made him determined to execute a comprehensive "Germania Sacra". For this purpose he examined numerous libraries and archives, and published (1727–1729) histories of the Church of Lorch and of the Sees of Passau and Salzburg: Germaniae Sacrae tomus primus: Metropolis Laureacensis cum episcopatu Pataviensi chronologice proposita (Augsburg, 1727), and an Archiepiscopatus Salisburgensis chronologice propositus (Vienna, 1729). This work took him to Rome, where he became acquainted with Muratori and Maffei. Hansiz is also considered the first historian who advanced the theory of the Slavic settlement of the Eastern Alps in the 6th century A.D., which was later generally accepted by historians.
Despite the composition of diverse short treatises, chiefly canonical and dogmatic, he did not lose sight of his main purpose, but gathered materials for his history of the Dioceses of Ratisbon, Vienna, Neustadt, Seckau, Gurk, Lavant, and for the secular history of Carinthia. However, the only result of his industry published by him on these subjects was a preliminary inquiry into the earliest periods of the See of Ratisbon, Germaniae sacrae tomus tortius. De episcopatu Ratisbonensi (Vienna, 1754). His copious notes are preserved in the Hofbibliothek (Court Library) in Vienna. Contrary to the Salzburg tradition, he maintained in his second volume that this see was founded by St. Rupert at the close of the seventh century; this aroused opposition. The third volume also involved him in controversy with the canons of St. Emmeram of Regensburg.
With advancing age he ceased personal researches, but induced his younger Jesuit peers, in Graz and Klagenfurt, to take up and carry on his work. With the same end in view he communicated, only a short time before his death, with the learned prince abbot, Martin Gerbert, the result being that the Benedictine Fathers, Emil Usserman, Ambrosius Eichhorn, and Trudpert Neugart, took charge of the work for the Dioceses of Würzburg, Chur, and Constanz.
He died in Vienna.