I am trying to find a way how to update a SharePoint solution programmatically with C#. (I already know how to do this with the powershell command Update-SPSolution).
I have tried using this code but it doesn't work:
SPSolution sol = SPFarm.Local.Solutions[name]; //name = mytest.wsp
sol.Upgrade(filePath); //C:\mytest.wsp
Can anyone provide some guidance?