I have one Document Library in central administration Name "Deployment List" it contains SharePoint Solutions(WSP files). now i want to add and deploy that solution using c# code it already get file and deploy it form Local drive but i want to get that file(WSP file from Document Library). I am using Timer job to deploy that solution Note : Solution are farm solution
my code is as follow :
try
{
// It give Error below line that "File not Found"
SPSolution solution = SPFarm.Local.Solutions.Add("http://centraladmin/Deployment List/MySolution.wsp");
Collection selectedWebApps = new Collection();
SPWebApplication webApp = SPWebApplication.Lookup(new Uri("http://localhost:80"));
selectedWebApps.Add(webApp);
solution.DeployLocal(true, true);
}
catch
{
}
I get "File not found" exception when i try to add the solution to the farm.
Any idea how to solve this error?