tag:blogger.com,1999:blog-4126985520350746834.post7023412038949243034..comments2024-03-28T07:00:21.554+00:00Comments on Chris O'Brien: Deploying web parts as a featureChris O'Brienhttp://www.blogger.com/profile/10022906552670607366noreply@blogger.comBlogger37125tag:blogger.com,1999:blog-4126985520350746834.post-75143260040508202152010-08-25T12:32:37.206+01:002010-08-25T12:32:37.206+01:00your articles are awesome chrisyour articles are awesome chrisUnknownhttps://www.blogger.com/profile/08323354041032068124noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-25260629824363063112010-01-06T11:48:12.938+00:002010-01-06T11:48:12.938+00:00@Robert Rakowitz,
In what way do the XML examples...@Robert Rakowitz,<br /><br />In what way do the XML examples not make sense? If you're using a tool to generate some of these files in the background (e.g. WSPBuilder, STSDEV, WSeWSS) then I agree *you* do not need to create them (e.g. manifest.xml, in the first screenshot), but something does! This article is coming up to 3 years old and such tools were either not around or in common usage at that time which might explain something.<br /><br />I'd love to go back and update articles like this with newer techniques, but then I'd never write new articles and feedback suggests that's more useful to most of my readers. That said, I discussed more up-to-date techniques quite recently in <a href="http://www.sharepointnutsandbolts.com/2009/10/my-favorite-sharepoint-2007-development.html" rel="nofollow">My Favorite SharePoint 2007 Development Techniques (with an eye on SP2010).</a><br /><br />Hope that's of some use.<br /><br />Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-21607193162002951092010-01-06T11:28:37.344+00:002010-01-06T11:28:37.344+00:00The given xml examples make no sense, since you ar...The given xml examples make no sense, since you are deploying the Webpart via the Solution (.wsp). When you include the in the solution you don't need the whole feature anymore. <br /><br />On the other hand you can deploy the webpart using the feature by not including the Tag in solution XML. <br /><br />Using the feature deployment you can also activate it for specific SiteCollection or even Sites (Webs) only.Robert Rakowitznoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-58159903614607100752009-12-30T11:20:21.740+00:002009-12-30T11:20:21.740+00:00@Ven,
A couple of things have moved on since this...@Ven,<br /><br />A couple of things have moved on since this article - I'd now recommend using <a href="http://www.codeplex.com/wspbuilder" rel="nofollow">WSPBuilder</a> which will create the manifest.xml, ddf file and create the WSP package from these for you. It's a very popular tool in common usage for SharePoint 2007 development, and removes the need to mess around with ddf files.<br /><br />You still need the feature.xml and feature elements file though.<br /><br />HTH,<br /><br />Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-29856811529762971852009-12-29T15:34:04.436+00:002009-12-29T15:34:04.436+00:00Hi Chris,
Where is the .ddf file? Also it...Hi Chris,<br /> Where is the .ddf file? Also it would be great, if you could show this in a sample project with more screen shots.<br /><br />Regards,<br />VenVenhttps://www.blogger.com/profile/07045548732044416161noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-1604064584021527062009-07-04T11:06:35.829+01:002009-07-04T11:06:35.829+01:00@Aman,
My first question would be why do you want...@Aman,<br /><br />My first question would be why do you want to deploy to both the bin directory <i>and</i> and the GAC? I can't really think of a valid case for this and am not even sure the .wsp framework supports it.<br /><br />In any case, for loading assemblies in the normal manner, .Net will <b>always</b> load assemblies from the GAC first, since this location is 'probed' earlier than the bin directory.<br /><br />HTH,<br /><br />Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-45560384790669523092009-07-01T10:25:08.496+01:002009-07-01T10:25:08.496+01:00Hi Chris,
I have a query. Suppose I am deploying ...Hi Chris,<br /><br />I have a query. Suppose I am deploying a dll to GAC as well as to BIN folder.Then how to make out whether the dll from GAC is used or DLL from Bin folder is being used.amanhttps://www.blogger.com/profile/07869343780247256159noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-5723737009737077902009-04-13T19:19:00.000+01:002009-04-13T19:19:00.000+01:00@Sagar,See previous comment to Nimish :-)Chris.@Sagar,<BR/><BR/>See previous comment to Nimish :-)<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-88466959771939673522009-04-13T19:18:00.000+01:002009-04-13T19:18:00.000+01:00@Nimish,If you mean you want to make a new web par...@Nimish,<BR/><BR/>If you mean you want to make a new web part available for selection without going through someone who has access to the server (e.g. an administrator), then I'm afraid the answer is no.<BR/><BR/>Generally your number 2 approach is the one used - if a web part could be made available without this process it would be a huge security/stability risk in most environments :-)<BR/><BR/>HTH,<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-47880080835286971932009-04-09T14:24:00.000+01:002009-04-09T14:24:00.000+01:00Hi Chris,Basically I need to deploy web parts on s...Hi Chris,<BR/><BR/>Basically I need to deploy web parts on share point server, but the issue is I dont have any access to the server. <BR/><BR/>Is there any way to do it<BR/><BR/>Thanks<BR/>-SagarUnknownhttps://www.blogger.com/profile/00439626166242067220noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-52761918873615122862009-04-08T11:30:00.000+01:002009-04-08T11:30:00.000+01:00Hi Chris,I know two ways of deploying the web part...Hi Chris,<BR/><BR/>I know two ways of deploying the web parts to the web part page.<BR/><BR/>1. Copying the web part .dll to the bin folder, adding safety tag to the web.config and then adding to the web part page.<BR/><BR/>2. Creating the .CAB file and then installing using stsmd command and then adding the web part to the web part page.<BR/><BR/>Both the above methods requires access to the server on which the sharepoint is installed and running.<BR/><BR/>Is there any way we can deploy the web part directly from the Sharepoint site without access the server?<BR/><BR/>Thanks,<BR/>NimishNimish Agarwalnoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-53368335171241840702009-02-24T17:06:00.000+00:002009-02-24T17:06:00.000+00:00I agree, the post is informative but cannot be cop...I agree, the post is informative but cannot be copied nor any sample was provided for download. Overall, the post was good. I don't want to criticize you. I still had to search looking for more information and found a similar one - <BR/>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/22/intro-to-sharepoint-development-how-to-build-and-deploy-a-web-part.aspxAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-42733497305368194112009-01-19T08:10:00.000+00:002009-01-19T08:10:00.000+00:00@Anonymous,Thanks for the feedback. A couple of po...@Anonymous,<BR/><BR/>Thanks for the feedback. A couple of points:<BR/><BR/>- agree the code samples are less useful than they could be due to not being able to copy/paste. This article was written before it was easy to add code samples to Blogger, and unfortunately I've not had time to go back to rewrite some of my early articles like this one<BR/>- my code/XML samples are from a 100% working example, so whilst you might need a 4 part assembly name in your scenario, I'm pretty sure I didn't in mine. Agree that strong-naming is a good practice though, and of course mandatory if deploying to the GAC<BR/><BR/>Since others have left positive feedback on the article, afraid I'm not going to be removing it based on your opinion. Sorry you didn't find it useful.<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-25188314212998198972009-01-17T04:07:00.000+00:002009-01-17T04:07:00.000+00:00Ur article sux. First of all, ur examples are made...Ur article sux. First of all, ur examples are made as imgs, so it is impossible to copy the code. Second, they r cut and text is just partially visible. Third, there is a bug about <BR/><BR/>< metaData ><BR/>< type name="TitleWP.TitleWP, TitleWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5" / ><BR/><BR/>The name must be strong with the PublicKeyToken.<BR/><BR/>I've spent the whole f-g evening trying to understand why my web-part doesn't work. Fix the bugs or remove the article, cause it is not just useless, its harmful.<BR/><BR/>BTW, the gj example:<BR/><BR/>http://www.theartofsharepoint.com/2007/05/how-to-build-solution-pack-wsp.htmlAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-16208623801508372582008-11-30T23:24:00.000+00:002008-11-30T23:24:00.000+00:00@Chris,So you have the .webpart file. Effectively ...@Chris,<BR/><BR/>So you have the .webpart file. Effectively you just need to follow the other steps detailed in this article to deploy it into the web part gallery so your customized version can be selected by users.<BR/><BR/>HTH,<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-48109789169750198862008-11-30T22:47:00.000+00:002008-11-30T22:47:00.000+00:00@Jagannath,Yes, I've seen this 'duplicate web part...@Jagannath,<BR/><BR/>Yes, I've seen this 'duplicate web parts' problem. I think it happens because the provisioning framework isn't really designed to deal with Feature re-activations in this way - it's mainly about the one-time provisioning of files. A couple of suggestions:-<BR/><BR/>- if you're only making changes to files defined in 'Module' elements, you should find that STSADM -o upgradesolution will update the .aspx but not cause the duplicate web parts.<BR/>- if you <I>do</I> need to re-activate the Feature (e.g. because you updated the Feature files), you'll probably need to script the removal of the duplicate web parts (using SPLimitedWebPartManager)<BR/><BR/>HTH,<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-25272622106540085212008-11-22T13:20:00.000+00:002008-11-22T13:20:00.000+00:00Hi Chris,Great post. Just took me a day to create ...Hi Chris,<BR/><BR/>Great post. Just took me a day to create a solution and deploy it in sharepoint. But I am facing an issue with a web part page. I use the Module/File tag to deploy the aspx file that has a webpart. But each time I redeploy the solution the web part keeps getting appended to existing stuff resulting in duplication. I guess this is because the aspx file is not deleted as part of undeploy. The aspx file is added as 'Ghostable' under root url(http://servername/my.aspx). How do I delete this file?<BR/><BR/>JagannathUnknownhttps://www.blogger.com/profile/06463792060641950706noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-30199789682385701542008-11-18T12:26:00.000+00:002008-11-18T12:26:00.000+00:00HI Chris,Could you help me please.. I have create...HI Chris,<BR/><BR/>Could you help me please.. I have created a CQWP in the GUI and exported it so i have cqwp.webpart. How can i then include this and change this to be added as a feature for easy deployment? I am struggling to figure out how to add it to the manifest etc...because its just an xml doc...<BR/><BR/>ThanksChris Pettigrewhttps://www.blogger.com/profile/15439200781916874712noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-83599445892748986152008-10-15T23:20:00.000+01:002008-10-15T23:20:00.000+01:00Cindy,This could be due to either your account not...Cindy,<BR/><BR/>This could be due to either your account not having the correct SharePoint permissions (e.g. is it a farm admin?) or IIS settings on the Central Admin website. Suggest you try changing the latter to anonymous access as a test..<BR/><BR/>HTH,<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-47929879971094068612008-10-08T09:02:00.000+01:002008-10-08T09:02:00.000+01:00Good article!I have question. I have installed Sha...Good article!<BR/><BR/>I have question. I have installed Sharepoint Services 3.0 in Microsoft Windows Server 2003 Enterprise Edition SPI. I open the SharePoint 3.0 Central Administration after installed. But, I cannot access to Operation and Application Management tab. It comes error : Access Denied!!<BR/><BR/>I would appreciate if you could tell me how to solve the problem. <BR/><BR/>thanks<BR/><BR/>Best Regards<BR/>Cindy TanAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-78434141709427719672008-09-28T10:49:00.000+01:002008-09-28T10:49:00.000+01:00Yes you can - there are no restrictions (AFAIK) on...Yes you can - there are no restrictions (AFAIK) on the number of elements (e.g. web parts) in a Feature or number of Features in a solution.<BR/><BR/>Often grouping things together (if they are related functionality) makes the most sense.<BR/><BR/>HTH,<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-4891941454482724182008-09-28T07:34:00.000+01:002008-09-28T07:34:00.000+01:00Hey can i deploy multiple webparts as features in ...Hey can i deploy multiple webparts as features in one goo ?<BR/><BR/>or <BR/><BR/>In one WSP can i have multiple webparts, which gets deployed as features.<BR/><BR/>< now i am posting as Anonymous >Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-74273365020595358992008-07-10T19:48:00.000+01:002008-07-10T19:48:00.000+01:00I don't think we can deploy a feature for a partic...I don't think we can deploy a feature for a particular site collection or web application even if we pass specific site collection urls or webapps during wsp depolyment. We install Features in the 12\Template\Features directory. SO after installation we are going to see features everywhere regradless of its scope. The feature scope just defines the context where the feature can be activated and deactivated. We even see a feature in a web app that's created after feature installation. That's true again regradless of its scope. The urls/webapps that we pass during solution deployment determine where to put web app resource files, dlls,etc... not the feature itself. Basically that's how we insatll features. There are no sitecollection urls or webapps parameter <BR/>stsadm –o installfeature –filename (path of the Feature.xml file relative to the 12\TEMPLATE\FEATURES folder )<BR/><BR/>let me know if i miss something. I have spent some serious time looking into this issue and that's what i found out.<BR/><BR/>Thanks,<BR/>AssefaAssefahttps://www.blogger.com/profile/00258822913929240510noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-58654424917208605972008-06-25T10:09:00.000+01:002008-06-25T10:09:00.000+01:00Hi Sumit,The answer is that it depends on what is ...Hi Sumit,<BR/><BR/>The answer is that it depends on what is in your Feature. The <A HREF="http://msdn.microsoft.com/en-us/library/ms454835.aspx" REL="nofollow">elements by scope table</A> lists which Feature elements can be deployed to each level.<BR/><BR/>If you have deployed something to an individual site collection only, it won't show up in the 'Site Collection Features' list of another site collection.<BR/><BR/>HTH,<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-90521994212235914512008-06-19T03:05:00.000+01:002008-06-19T03:05:00.000+01:00Hi Chris,Nice Article! Thanks for putting hard wor...Hi Chris,<BR/><BR/>Nice Article! Thanks for putting hard work on this. I've a question here.<BR/><BR/>Can I deploy a feature for a particular site collection or web application? I don't want other site collections or web applications to see it in their Features list.<BR/><BR/>Thanks,<BR/>SumitSumit Kumar Domyanhttps://www.blogger.com/profile/11528980154880451186noreply@blogger.com