Posts

Showing posts with the label wsp

Sharepoint 2010 - Assign Category to your Site Template (without VS)

Image
Set your Site Template in a Category is (maybe) simple with Visual Studio, but not the faster way. I tried with success by editing some xml in WSP package. Here step by step my solution. Save your site as template, "My_Site". Go in Solutions Gallery and download your My_Site.wsp package on desktop. Rename extension from .wsp to .cab. Use your tool to extract and create CAB archive, I used SimplyZip . Extract My_Site.cab and open to edit file Elements.xml in folder “ My_SiteWebTemplate ”. Add attribute DisplayCategory="My Site Templates" in tag “< WebTemplate> ” and save file. Use your tool to create new file My_Site.cab with all files from original cab and modified file. Note : with SimplyZip use Drag&Drop to set files and folders to add in cab. Change extension from .cab to .wsp and upload My_Site.wsp on Solutions Gallery. Now, try to create new Site: in the " Filter By:" section, you see  My Site Templates category...

SharePoint 2010 WebPart Properties not saving

Image
I lost many time to find the way to save properties of a custom web part in Sharepoint 2010. All my classes, methods, properties are defined correctly, but when I deploy web part and I try to save props, values were not saved and web part load with his default values. Then I search for solution and I found that it is due to disposing the current web (SPContext.Current.Web). I understood that I don't have to dispose SPContext.Current.Web object in my code and neither use using(SPWeb web = SPContext.Current.Web). The solution is to use directly SPWeb web = (new SPSite(SPContext.Current.Site.ID)).openweb(SPContext.Current.Web.ID); to initiate a new web object and then dispose it after using. The Save button finally saved properties values!

Sharepoint 2007 - Deploy in produzione con Visual Studio 2008

Dopo aver partecipato a corsi di Sharepoint 2010 e visto quanto sia (relativamente ok...) semplice eseguire il Deploy di soluzioni dall'ambiente di test all'ambiente di produzione, mi sono scontrato con la realtà di Sharepoint 2007... Il deploy di una web part custom, implementata con Visual Studio 2008. Lo sviluppo è andato liscio, senza problemi. Il deploy in ambiente di test, ancora più semplice: tasto destro sul progetto, click su Deploy e via. Ora è giunto il momento del deploy in produzione.. Come fare? Diversi forum mi propongono soluzione a detta loro "semplici", con creazione di un progetto CAB per generare un package da copiare in produzione e poi deploy con stsadm. Non è così facile. Almeno, io ho incontrato difficoltà per due motivi: - o riconosce il file come CAB quindi vuole addpackage anziché addsolution - o (se rinominato in .wsp) non vuole addsolution - o mi dice che manca il manifest.xml (pur essendoci) Allora, ho seguito una mia strada. Da Visual S...