Domanda

Ho una biblioteca dei documenti nel nome dell'amministrazione centrale "Elenco di distribuzione" Contiene SharePoint Solutions (file WSP).Ora voglio aggiungere e distribuire quella soluzione utilizzando il codice C #, ottieni già il file e distribuisci il modulo Drive locale ma voglio ottenere quel file (file WSP dalla libreria dei documenti).Sto usando il lavoro timer per distribuire questa soluzione Nota: la soluzione è soluzione agricola

Il mio codice è il seguente:

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
{
}
.

ottengo l'eccezione "file non trovato" quando provo ad aggiungere la soluzione alla fattoria.

Qualche idea come risolvere questo errore?

È stato utile?

Soluzione

Well you didn't specify an error, but I am guessing it doesn't know what you are talking about when you give it that url.

When you deploy to SharePoint it expects a physical file in a physical location.

I had a similar problem trying to parse the contents of .doc files from the old 2003 Office library.

We ended up downloading the file to the filesystem, processing it, then deleting it from the filesystem. The same would work here and you would maintain the transparency you are looking for.

Download the file to the server filesystem

Deploy the file

Delete the file from the filesystem

Altri suggerimenti

Your code does not work as the Solution.Add method expects a System.IO.Path, not a Uri. You need to specify a valid Path (UNC, local path, etc.) when using Solution.Add("path").

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top