The current[1] parish church was built between 1806 and 1820 to replace the old sacred building which, according to Christian tradition, had the apse with the altar to the east (towards the Martesana canal), the façade facing west and it occupied the area of today's churchyard. The reason for this complete replacement is the will of Duke Gian Galeazzo Serbelloni (1744-1802), lord of Gorgonzola. Serbelloni obliged his only heir, Luigia Busca, to allocate an annual income of 16,000 lire to the construction and maintenance of two buildings to be built from scratch in Gorgonzola: the church and the hospital. The duke also indicated the name of the person responsible for the projects, the Ticino-born Simone Cantoni (1739-1818), a trusted architect of his father Gabrio and author, among other things, of the Serbelloni palace in Milan (as well as the reconstruction of the Ducal palace in Genoa and many churches and villas between Lombardy and Canton Ticino).
The monumental complex conceived by Cantoni envisages, after some unrealized design hypotheses[2], leaving the space occupied by the old church free and building the new one with an apse to the north and a façade to the south. The first stone was laid on 1 June 1806 with solemn ceremony and the works, amidst interruptions and delays, continued even after the death of the architect Cantoni, who fell ill during an inspection of the construction site in 1818 and was buried in the mausoleum that he himself had designed. The new temple was consecrated on 22 October 1820 by the archbishop of Milan, Cardinal Gaisruck, although the completion and decoration works continued for most of the following decades (the pronaos in the center of the facade dates back to 1881).
The title of prepositural which the church of Gorgonzola boasts recalls the role of capital of the parish of the same name, a religious and civil reference point for the surrounding area since at least the 10th century.