Click here to Skip to main content
Click here to Skip to main content

Visual Studio Add-In for Web Parts Generation

By , 19 Jan 2009
 

Introduction

This article will introduce you to a new Visual Studio 2005/2008 add-in that can be used for Web Parts generation based on a prepared ASCX control/template. The add-in should allow Web Part developers to easily make Web Parts using the Visual Studio HTML designer. It should save you a lot of time and make Web Part development an enjoying experience even for beginners.

This article is written in the form of a step-by-step tutorial. It will give beginners a chance to successfully make, deploy, and try their first Web Parts, and will save some time for advanced users as you can always run into challenges when working with SharePoint.

Background

A year ago, we released the first version of this Web Parts generator. The first version was made as a console application and its source code is hosted on CodePlex. I also posted an article here on CodeProject, explaining how that console application should be used for Web Parts generation (Base class for skinned Web Parts and generator tool).

I promised that we'll make a Visual Studio add-in to make the Web Parts development process even faster, and I kept my promise.

Using the add-in

This section will show how the add-in should be used for Web Parts generation, how a Visual Studio solution should be created before development starts, and how the developed solution can be deployed and tested.

Preparing a new Visual Studio solution

We will start by preparing a new Visual Studio solution. In order to be able to follow the steps from this section, you'll need to have a development environment with these installed:

  • MOSS 2007
  • Visual Studio 2005 with Service Pack 1 (or 2008)
  • Visual Studio Extensions for Windows SharePoint Services (you can download it from here)
  • The Visual Studio add-in that you can download from this page

Please follow these steps in order to prepare a new Visual Studio solution that will host Web Parts and their skins:

  1. Start Visual Studio and select "File" --> "New" --> "Project".
  2. Select the "Web Part" template from the list of available templates, as in this screenshot:
  3. ScreenHunter_02.jpg

  4. Enter the name of your project, the name of your solution, select the "Create directory for solution" option, and click on the OK button. You will get a new solution with a "Web Part" project.
  5. You will notice that the "Web Part" template already created a Web Part with the same name as the name you entered for your Web Part project. We will now remove that Web Part as we want to use this project for multiple Web Parts. To remove the Web Part, you should right click on the sub-folder that holds the Web Part and choose "Delete" from the context menu as in the next screenshot:
  6. ScreenHunter_03.gif

  7. We will now add a new project to Visual Studio to hold the skins/templates for our Web Parts. To do that, select "File" --> "New" --> "Project". Then, select "Class Library" from the list of templates, enter a name for this new project, choose the "Add to Solution" option, and click on the "OK" button as in the next screenshot:
  8. ScreenHunter_04.jpg

  9. Visual Studio will create a class called "Class1" because we selected the "Class Library" template. We will now delete that class and prepare it for skins/templates hosting. You should right click on "Class1.cs" and choose "Delete" from the context menu as shown:
  10. ScreenHunter_05.gif

  11. Now, right click on your "Class Library" project and choose "Add" --> "New Folder". Enter "Themes" for folder name, and then create a sub-folder below that folder and name it "default". You should now have a structure like in this screenshot:
  12. ScreenHunter_06.gif

Creating a skin/template for our Web Part

  1. We will now create our first skin/template for a new Web Part. Right click on the "default" folder and choose the "Add New Item" option. Choose "Text File", enter a name for the skin/template with the extension ASCX, and click on the "Add" button as in the next screenshot:
  2. ScreenHunter_09.jpg

  3. You should now have a structure like in this screenshot:
  4. ScreenHunter_10.gif

  5. Double click your ASCX file and enter some HTML into it. The following screenshot shows a simple skin/template with a Label, a TextBox, a Button, and a few more plain HTML controls:
  6. ScreenHunter_11.jpg

Creating the initial version of the Web Part

We will first create a new Web Part that will be used only as a placeholder for the Web Part that will be generated later.

  1. To create a new Web Part, you should right click on your "Web Part" project and select "Add" --> "New Item":
  2. ScreenHunter_14.gif

  3. Then, choose "Web Part" from the list of templates, enter a name for your Web Part, and click on the "Add" button:
  4. ScreenHunter_15.gif

    Please notice that although this is just a placeholder for the Web Part that will follow, you should enter the name of your Web Part as you want it to be named later.

At this point, you should have a structure like in this screenshot:

ScreenHunter_16.gif

and the source code of the placeholder Web Part should be like this:

ScreenHunter_18.jpg

Web Part generation

We now have all the projects prepared and a placeholder Web Part ready. To generate your first Web Part based on a previously prepared skin/template, you should follow these steps:

  1. Right click on your skin/template and choose "Generate SharePoint WebPart":
  2. ScreenHunter_19.gif

  3. Click on the "..." button to the right of the "Output WebPart file" field:
  4. ScreenHunter_20.gif

  5. Navigate to the Web Part placeholder that you created in one of the previous steps and select that file. You should see a warning message saying that you will overwrite an existing file. You should just confirm that you want to proceed:
  6. ScreenHunter_21.gif

  7. Enter the appropriate value for "Namespace" and click on the "Generate" button:
  8. ScreenHunter_22.gif

  9. Click on the "Web Part" project and then select the "Show All Files" option in Solution Explorer's toolbar:
  10. ScreenHunter_24.gif

  11. You should see a new file named the same way as your Web Part but with ".generated." in the file name. Right click on that file and choose the "Include In Project" option:
  12. ScreenHunter_25.gif

You should now have a structure like this:

ScreenHunter_26.gif

You can optionally modify your project to have the ".generated." file be dependent on the original file. You can do that if you go to the file system, locate and edit the ".csproj" file for your "Web Part" project, and modify the "include" line for the ".generated." file. An example of a section that includes this file in my sample is:

ScreenHunter_27.gif

and an example of a modified section is:

ScreenHunter_28.gif

If you make it dependent, then the project structure should look like this:

ScreenHunter_29.gif

Preparing for deployment and testing

Follow these steps to prepare an environment for deployment and testing:

  1. Download ASPNETLibrary.SharePoint.WebParts.dll from here.
  2. Right click on the solution in Solution Explorer and choose "Add" --> "New Solution Folder" as shown:
  3. ScreenHunter_30.gif

  4. Enter "ExternalLibraries" for the solution folder name:
  5. ScreenHunter_31.gif

  6. Open Windows Explorer, navigate to the solution folder on the file system, and create a folder with the same name in the root of the solution's folder:
  7. ScreenHunter_32.gif

  8. Extract the downloaded DLL into the "ExternalLibraries" folder on the file system.
  9. Go back to Visual Studio, right click on the solution folder, choose "Add" --> "Existing Item", navigate to th location where you downloaded ASPNETLibrary.SharePoint.WebParts.dll, and select the DLL. You should now have a structure in Visual Studio like this:
  10. ScreenHunter_33.gif

  11. Right click on the "References" node under your "Web Part" project and choose the "Add Reference" option:
  12. ScreenHunter_34.gif

  13. Select the "Browse" tab, navigate to the "ExternalLibraries" folder on the file ,system and choose the extracted DLL:
  14. ScreenHunter_35.gif

  15. You should now have ASPNetLibrary.SharePoint.WebParts.dll in the list of references. Check if your references list looks like this:
  16. ScreenHunter_36.gif

  17. Now, double click on the Web Part class file and enter some code. In this example, we will subscribe to the Button.Click event of our single button, and will set some text into the text box when the button is clicked:
  18. ScreenHunter_37.gif

  19. Open Internet Explorer and navigate to the website where you'll deploy the Web Parts and test them.
  20. Click on "View All Site Content":
  21. ScreenHunter_39.gif

  22. Click on the "Create" button:
  23. ScreenHunter_40.gif

  24. Select "Document Library" from the list of definitions:
  25. ScreenHunter_41.gif

  26. Enter "Themes" for the document library name and click on the "Create" button:
  27. ScreenHunter_42.gif

  28. Click on "New" and then "Folder":
  29. ScreenHunter_43.gif

  30. Enter "default" as the folder name and click on "OK".
  31. Select the "default" folder:
  32. ScreenHunter_44.gif

  33. Select "Upload" and then the "Upload Document" option:
  34. ScreenHunter_45.gif

  35. Browse to the folder that holds your skin/template and select the skin/template that you previously created. You should now have the skin/template in the "Thems\default" folder:
  36. ScreenHunter_46.gif

  37. Go to the root folder of your MOSS IIS website and open the web.config file. This folder is usually here: "c:\inetpub\wwwroot\wss\VirtualDirectories\PORT" where PORT is the port number of your IIS website:
  38. ScreenHunter_48.gif

  39. Locate the "SafeControls" section and add this line before the closing the "SafeControls" tag: <SafeControl Assembly="ASPNETLibrary.SharePoint.WebParts, Version=1.0.0.1, Culture=neutral, PublicKeyToken=fbf2c912531db231" Namespace="ASPNETLibrary.SharePoint.WebParts" TypeName="*" Safe="True" />.
  40. You should now have the SafeControls section in the web.config like this:
  41. ScreenHunter_49.gif

  42. Open Windows Explorer and navigate to "c:\Windows\Assembly". Open another Windows Explorer and navigate to your "ExternalLibraries" folder. Drag and drop "ASPNETLibrary.SharePoint.WebParts.dll" from "ExternalLibraries" to "c:\Windows\Assembly":
  43. ScreenHunter_51.jpg

Deploying Web Parts 

We are now ready to deploy our first Web Part. To do that, follow these steps:

  1. Right click on the "Web Part" project and choose the "Deploy" option:
  2. ScreenHunter_52.gif

  3. The deployment process will start and you should see the following messages in the left bottom corner of the Visual Studio window when the deployment is successfully completed:
  4. ScreenHunter_53.gif

  5. Open Internet Explorer and navigate to your MOSS website.
  6. Select "Site Actions" and then "Edit Page":
  7. ScreenHunter_54.gif

  8. Click on "Add a Web Part":
  9. ScreenHunter_55.gif

  10. Locate your Web Part in the list of Web Parts, select the check box next to it, and click on the "Add" button:
  11. ScreenHunter_56.gif

  12. You should now see your Web Part:
  13. ScreenHunter_57.gif

  14. To test its functionality, click on the "Submit" button, and if all the previous steps were performed correctly, then you should see a text box filled-in with the "Hello world!" message:
  15. ScreenHunter_58.gif

Source code and other resources

The complete source code for this add-in and the related DLLs is located on CodePlex.

License

This article, along with any associated source code and files, is licensed under The Common Development and Distribution License (CDDL)

About the Author

Sasa Popovic
CEO Vega IT Sourcing
Yugoslavia Yugoslavia
Member
Sasa Popovic has M.Sc degree in Computer Sciences and Electrical Engineering.
 
He is a Software Architect and co-owner at Vega IT Sourcing - http://www.vegaitsourcing.rs.
 
Sasa is owner and contributor of several projects at codeplex (http://www.codeplex.com/aspnetlibrary).
 
You can read more about Sasa Popovic or add him to your contacts list at: LinkedIn

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionMy Vote of 5memberRaviRanjankr19 Nov '11 - 3:05 
Nice article Thumbs Up | :thumbsup:
GeneralAmazingmemberSendilkumar.M25 Aug '10 - 18:23 
In India is it possible for CEO to post this kind of core technical articles?
 
Smile | :)
M.Sendilkumar

QuestionHow Could I Add Some User Controls ?memberaria_cop3 Apr '10 - 1:36 
Hi,
 
Thank you for your idea,
 
I want to have a webpart with some user control.
 
i try to add a new webpart to my project and a new user control to skins.
 
but "generate web part " always get error (there is not and server tags).
 
could i add new skin (user control) to One web part? how?
 
it is important to me to have ONE .dll .
QuestionDeploy Succeed But Webpart is not availablememberaria_cop30 Mar '10 - 21:32 
Hi
 
thank you for your article
 
i have VS2008 and MOSS 2007.
 
I deploy my webpart and deploy succeeded shown but when i goto moss site the web part is not added.
 
whats wrong?
GeneralCreate Custom SharePoint WebParts, it is simple.memberitsaranga1 Oct '09 - 0:33 
Nice !!!!!!!!
 
Try this too,
Custom SharePoint WebParts
QuestionUnable to add selected web part(s). Cannot import _EricomWebPortal Web Part.memberMichealBarlow30 Sep '09 - 7:07 
Hi,
 
I believe i have followed the tutorial correctly but when i try add the web part to a page i receive an error Unable to add selected webpart and would appreciae it if someone is able to assist or send me an example VS2008 project so i can compare.
 
Thanks,
Mike
Generalobject reference not set to an instance of an objectmemberMember 227494310 Sep '09 - 9:36 
Hi Sasa.
 
This is a really great article.
 
When I try to deploy it I receive the error "object reference not set to an instance of an object". It doesn't give me a file or a line to check it out. I was wondering if you've seen this error before or if you knew a way of debugging it?
 
I use Visual Studio 2008 and the only thing different in my project than yours is that I also have two other files that you do not have in my folder "MyFirstSkinnedWebPart". There's "MyFirstSkinnedWebPart.webPart.webpart" and "MyFirstSkinnedWebPart.xml".
 
This is my code on MyFirstSkinnedWebPart.cs because it also looks a little different:
 
using System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.WebControls;
using System.Xml.Serialization;
using System.ComponentModel;
 
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
 
using ASPNETLibrary.SharePoint.WebParts;
 
namespace SampleWebParts
{
[XmlRoot(Namespace = "SampleWebParts")]
[GuidAttribute("42450357-ddce-47a2-8653-15c06eb40c36")]
[DefaultProperty("Text")]
[ToolboxData("<{0}:MyFirstSkinnedWebPart runat=server></{0}:MyFirstSkinnedWebPart>")]
public partial class MyFirstSkinnedWebPart : BaseSkinnedWebPart
{
#region [Methods]
 
protected override void Initialize(Control skin)
{
//TODO: add any extra initialization here (like attaching to Button.Click events,
//setting the initial data to server controls, etc)
this._button1.Click += new EventHandler(SubmitClick);
}
 
#endregion [Methods]
 
public MyFirstSkinnedWebPart()
{
this.ExportMode = WebPartExportMode.All;
}
 
void SubmitClick(object sender, EventArgs e)
{
this._label1.Text = "Hello World";
}
}
}
 
Thank you for taking a look at this.
 
-Harry
GeneralError while generating code from my skinned usercontrolmemberMoustafa Arafa8 Jul '09 - 5:10 
Hi,
 
I'd like to thank you first for great job you have done it in this add-in.
 
second, i have a problem generating the code from my user control, the error when click on generate button which i'm getting:
 
"Value can not be null, parameter name type".
 

How can i fix this ?
 
I'm using this addin with VS 2005 on my Virtual machine.
 
Regards,
Moustafa M.Arafa

GeneralRe: Error while generating code from my skinned usercontrolmemberSasa Popovic8 Jul '09 - 10:29 
Hello Moustafa,
 
Do you have at least one control with "runat='server'" and a valid ID? Did you try to put the HTML from my examples into your ASCX and did it work with that sample HTML?
 
Regards,
Sasa
 

GeneralGreat Work :thumbsup:memberInvincibleAngel20 May '09 - 0:33 
Hi, Great work. realy a very nice idea. I have gone through all the steps but when i try to deploy the webpart the VS 2008 fails. Will you please help me in this regard. The error message that i am getting is in Danish. I dont know why is it in Danish.
The error message is
Kan ikke fuldføre denne handling. which means Can not complete this action. try again.
 
Thanks and realy a very nice article. 5/5 from my side Smile | :)
GeneralRe: Great Work :thumbsup:memberSasa Popovic20 May '09 - 0:42 
I'm glad that you like the idea.
 
Please try the following:
- right click on web part project and select Properties
- go through tabs and find a property that defines URL to web server (I don't have development environment with me and don't recall the name of the tab and property)
- set the property's value to URL of your MOSS website (for example, set it to "http://localhost" if you have MOSS running on default port and if you are testing with root website).
 
Let me know if that helped.
 

GeneralRe: Great Work :thumbsup:memberInvincibleAngel20 May '09 - 2:33 
Yes, it worked thanks Smile | :)
so nice of you...
GeneralRe: Great Work :thumbsup:memberInvincibleAngel20 May '09 - 3:17 
hi, Sorry to disturb you once again but when i am trying to add the control in my sharepoint cite it shows Unable to add selected web part(S) cannot import this web part
GeneralRe: Great Work :thumbsup:memberAhmed Ramy18 Jul '09 - 12:44 
Hi,
I'm getting the same error "Unable to add Web part"
Had you found a solution for this
 
Blog: http://dotnetQPearl.com/blogs/ahmed_ramy/
 
WebSite:
http://AhmedRamy.com

GeneralRe: Great Work :thumbsup:memberSasa Popovic18 Jul '09 - 23:29 
I would suggest you check SafeControls section in web.config file and see if there is an entry as specified in this article.
 
Also check if the right DLLs are in Global Assembly Cache.
 

GeneralCould not find skin: /Themes/default/Myskinwp.ascxmembermfkosta20 Apr '09 - 19:42 
Hi there,
 
Great idea and really nice implementation. I started to do something similar but your implementation is really good and well structured. However I'm getting "Could not find skin: /Themes/default/Myskinwp.ascx" and can not get over it. Couple of things I notice: Themes library is not site specific so if you have it on site collection level it's try to pick up it first instead of /YourSite/Themes/. I'll try to use the source and try to debug it but if you have any idea why I'm getting "Could not find skin" it will be greatly appreciated.
 
Regards, Kosta
GeneralRe: Could not find skin: /Themes/default/Myskinwp.ascxmemberSasa Popovic23 Apr '09 - 4:47 
Hi Kosta,
 
Thank you.
 
You are right about the Themes document library, it is not site specific. It's just the way we decided to do it. There is an alternative and that is to use ASCX files from file system directly and to use XML configuration. I didn't write an article about that before but you can try to see how to use it by looking into source code.
 
If you made Themes document library in at site collection level and if you have "default" folder in it but you are still getting the "Could not find skin" error then please try next:
- Select "Modify Shared Web Part" option on your web part
- In list of themes select "default"
- In list of skins select the right skin/ASCX for your web part.
 
Let me know if that worked.
 
Regards,
Sasa
 

GeneralRe: Could not find skin: /Themes/default/Myskinwp.ascxmembermfkosta29 Apr '09 - 13:15 
Hi Sasa,
 
I see your point about “use ASCX files from file system directly”.
 
In site collection scenario it fails on
(HostingEnvironment.VirtualPathProvider.FileExists(skinPath)) inside BaseSkinnedWebPart class because SkinPath returns /{0}/{1}/{2} and by default it’s /Themes/default/yourskin.ascx. In site collection case it’s should look like /sites/yourSiteCollectionName/Themes/default/ yourskin.ascx so above statement returns false. One of the solutions can be to make BaseSkinnedWebPartSettingsToolPart return full path to the skin.
 
Couple of other notes (my env is server 08 + VS08):
 
1. I tried to use you latest code but for some reason it’s failing on “ConfigHandler” singleton initianisation during runtime.I do not know why but during debug it’s never get’s there and fails on “WebPartSkin skin = ConfigHandler.Instance.GetSkin(this.ThemeName, this.SkinName);” inside BaseSkinnedWebPart, complaining that Instance is null. I have no idea why it’s happens. So I have to use one of the first revisions of the code.
 
2. In terms of installation of generator plug-in: on my env I notice that if during install you use “for all” option it’s failing to add that “generate” on your right click. So what worked for me was to install it to default location (VS05), use “make changes for you only” option and in VS08 add that path in Tools->Option->Environment->Ad-in/Macros Security. Only slight annoying thing that both VS now complain several times about something like “index is out of range” on the start.
 
I’m hope it’s all makes since and might be helpful for other people that come across that really good and super useful project.
 
Thank you,
 
Kosta.
Question"Generate Sharepoint Webpart" filed is not appearing [modified]memberMember 114965624 Mar '09 - 17:08 
Dear Sasa,
 
First of all I would like to say that you have made good job with this article and thank you for your help.
 
My problem is when I try to Gererate Sharepoit webpart by right click "Generate Sharepoint Webpart" filed is not appearing
 
I am using vs2008
 
Thanks in advance.
Lalith
 
modified on Tuesday, March 24, 2009 11:27 PM

AnswerRe: "Generate Sharepoint Webpart" filed is not appearingmemberSasa Popovic24 Mar '09 - 22:50 
Dear Lalith,
 
Do you get "Generate SharePoint WebPart" menu item when you right click on an ASCX file? If yes, do you get any error message when you click on that menu item.
 
Regards,
Sasa
 

AnswerRe: "Generate Sharepoint Webpart" filed is not appearingmemberMember 114965624 Mar '09 - 23:01 
Dear Sasa,
Yes I have clicked on ASCX file. Anyway, After add that Add-in by manually by selecting Tools->Options->Add-in/Macros Security and add the Add-In installed folder It was fixed.
Thanks for Reply
Lalith
GeneralNo sharepoint site exists at the specified URLmemberMember 371161919 Mar '09 - 4:57 
Dear Sasa,
 
First of all I would like to say that you have made good job with this article and thank you for your help.
 
My problem is when I try to deploy solution I get this error: No sharepoint site exists at the specified URL.
 
Do you think that problem could be uploaded file in default folder?
 
I don't know what is the problem.
 
Thanks in advance.
 
Branislav Tosic
GeneralRe: No sharepoint site exists at the specified URLmemberSasa Popovic19 Mar '09 - 5:31 
Branislav,
 
Right click on your web part project, select "Properties", go to "Debug" tab and check startup URL. It should point to a SharePoint website where you would like to deploy your web part(s). I guess you have a wrong URL there so that is why Visual Studio is reporting that "No SharePoint site exists at the specified URL" when it tries to deploy your solution.
 
Let me know if that didn't help.
 
Regards,
Sasa
 

GeneralRe: No sharepoint site exists at the specified URLmemberMember 371161920 Mar '09 - 2:26 
Sasa,
 
thank you very very much for your help. It was succesfully deployed on SharePoint.
 
Another thing is that when I add webpart to SharePoint it says that webpart cannot be imported.
 
I think the problem lies in my configuration. I will try again from the start.
 
Thanks again.
 
Branislav Tošić
 
P.S.: puno ti hvala na pomoći. Ako imam nekih problema javiću se. Hvala još jednom.
QuestionSharepoint Servicesmemberkevinduk12 Mar '09 - 4:57 
Hi Sasa
 
I am running VS2008 and installed as instructed by changing the folder to 2008 instead of 2005
 

When I try to Generate Skinned WebPart I get the following error
 
Error: There are No Server Controls! Generation will Not be performed
 
There were also errors saying that coredefinitions.xsd could not be found in the xml/schemas directory for studio9.
 
Any ideas what may be wrong?
AnswerRe: Sharepoint ServicesmemberSasa Popovic12 Mar '09 - 10:11 
Hi,
 
You either didn't put any ASP.NET controls into your skin or you have a non valid XHTML skin file. Try adding at least one ASP.NET control (or HTML control) with runat="server" attribute first. If that doesn't help then try validating your HTML file to be sure that you properly closed all tags.
 
Let me know if that doesn't help and post the content of your skin so that I can see what is causing the error.
 
Regards,
Sasa
 

GeneralRe: Sharepoint Servicesmemberkevinduk20 Mar '09 - 0:50 
Hi Sasa
I have just reread the article and saw that you mention MOSS specificaly. I only have WSS is this likely to be the problem?
Thanks
 
Kevin
GeneralRe: Sharepoint Servicesmemberkevinduk20 Mar '09 - 0:53 
Hi Sasa
I have just re read the article and saw that you mention MOSS specificaly. I only have WSS. does this work for WSS?
 
Thanks
 
Kevin
GeneralRe: Sharepoint ServicesmemberSasa Popovic20 Mar '09 - 1:56 
Hi Kevin,
 
I didn't test it with WSS but it should work without any problems.
 
Did you check ASCX file? Are you still getting an error and if so, which one?
 
Regards,
Sasa
 

GeneralGreat workmemberAntonijo Todorovik23 Feb '09 - 6:26 
Hi,
 
Nothing more to add, really goor article ... I'm having some troubles with my VStudio instalation, but your work is more then helpfull...
 
Best regards, Thumbs Up | :thumbsup:
A.
 
P.S.: Iako je internacinalni sajt, chestitam i na nashem jeziku.... mogucje je da ti postavim neko pitanje, kao pomocj i to... Pozdrav iz Madrida...
GeneralRe: Great workmemberSasa Popovic23 Feb '09 - 6:56 
Hi Antonijo,
 
Thank you for your comment. I'm glad you found it helpful.
 
Feel free to contact me if you need help.
 
Regards,
Sasa
 
P.S. Nadam se da problem sa VisualStudio-om nema veze sa Add-In-om Big Grin | :-D . Do sada niko nije prijavio nikakve probleme pa slobodno javi ako primetis neke probleme.
 

GeneralRe: Great workmemberAntonijo Todorovik23 Feb '09 - 22:42 
Hi,
 
No, no, the problem is not with your add-on, the problem is with my Visual Studio 2008 installation. I'm using the Proffesional Edition on a Virtual machine. I was not able to get this WebPart template in the VisualStudio. I have installed the latest updates and the extensions for the VStudio (extensions v1.1 and v1.2 also), thinking I will get them and make my life easier, but nothing yet...
 
So, I need some experiance talk here, any help would be welcomed...
 
Best regards, Antonijo
GeneralRe: Great workmemberSasa Popovic23 Feb '09 - 23:15 
Antonijo,
 
To get started working with SharePoint I would suggest next configuration:
- A virtual machine with Windows Server 2003,
- VisualStudio 2005 Professional with ServicePack 1 (or 2008) installed on virtual machine,
- VisualStudio Extensions for SharePoint Services:
*** For VS2005: http://www.microsoft.com/downloads/details.aspx?familyid=3E1DCCCD-1CCA-433A-BB4D-97B96BF7AB63&displaylang=en[^]
*** For VS2008: https://www.microsoft.com/downloads/details.aspx?familyid=7BF65B28-06E2-4E87-9BAD-086E32185E68&displaylang=en[^]
 
Let me know if that helped or not.
 
Sasa
 

GeneralRe: Great workmemberAntonijo Todorovik24 Feb '09 - 1:25 
Hi again,
 
Exactly my case: virtual machine with Windows Server 2003 + Visual Studio 2008 Professional Edition + VisualStudio Extensions for SharePoint v1.2... and no result...
 
Any other idea?
 
Thanks in advance,
Antonijo
GeneralRe: Great workmemberSasa Popovic24 Feb '09 - 21:40 
Antonijo,
 
Can you find "Extensions for SharePoint Svcs" (or similar) product in list of "Installed Products" when you open VisualStudio and select "Help ==> About Microsoft Visual Studio" in horizontal menu?
 
If you can see it then it means you installed it and they you should see "Web Part" in list of "Visual Studio installed templates" when you go to "File ==> New ==> Project" and click on "Visual C#" (for example).
 
Let me know what you saw on those screens.
 
Regards,
Sasa
 

GeneralRe: Great workmemberAntonijo Todorovik25 Feb '09 - 1:11 
Hi Sasha,
 
OK, I have it now. The problem was in the link for the VS2008 extensions v1.2, it is not installing correctly, but if You install all the templates for VS2008, then it works fine and I can now visualize the WebPart template now...
 
Thanks a lot for the help... now I will get a deeper look at your add-on...
 
Regards, A.
GeneralRe: Great workmemberSasa Popovic25 Feb '09 - 1:14 
You are welcome. I wish you success!
 

GeneralRe: Great workmemberAntonijo Todorovik25 Feb '09 - 6:29 
Hi again,
 
Just one thing more, that I have noticed just before ending all the steps:
 
When I do right click over the skin/template, I don't get the option "Generate SharePoint WebPart" (image 19 - ScreenHunter_19.gif from your step by step tutorial). Any ideas why??
 
I have installed the add-in (SkinnedWebPartsGeneratorAddIn.msi) correctly.
 
Kind regards,
A.
 
P.S. Povezacju te na LinkedIn-u...
GeneralRe: Great workmemberSasa Popovic25 Feb '09 - 8:00 
Did you install the Add-In? The link for download is available at the top of the page (http://www.codeproject.com/KB/sharepoint/webparts_generator_addin/SkinnedWebPartsGeneratorAddIn.zip[^]).
 
I'm not sure if you read comments below but for Visual Studio 2008 you will need to manually change target folder during installation of Add-In. If you didn't do that then I suggest you:
1. Close Visual Studio,
2. Uninstall the Add-In (Control Panel ==> Add/Remove Programs),
3. Start installation again and
4. Change "2005" into "2008" in folder path when asked to confirm/choose installation folder.
 
Let me know if that helped.
 

GeneralWrong link to CodePlex projectmemberSasa Popovic2 Feb '09 - 10:25 
One of the readers of this article reported to me that a link to codeplex project is not valid.
The link should be http://www.codeplex.com/aspnetlibrary[^]
 

GeneralInstall path - VS 2008memberstephen.gaspard25 Jan '09 - 2:34 
Great article.
 
I will just add one remark, when I started addin install, the setup proposed to install to VS2005 addins folder. I had to manually change 2005 into 2008 to install it for Visual Studio 2008.
GeneralRe: Install path - VS 2008memberSasa Popovic25 Jan '09 - 3:07 
Hi Stephen,
 
I'm glad that you liked the article.
 
Thank you for remark. We should make two installations - one per VisualStudio version.
 
Regards,
Sasa
 

GeneralGreat Work!memberMansaah23 Jan '09 - 20:45 
Good work manThumbs Up | :thumbsup:
GeneralRe: Great Work!memberSasa Popovic23 Jan '09 - 21:18 
Mansaah,
 
Thank you very much!
 
It's great to hear that our hard work is appreciated by community.
 
Regards,
Sasa
 

GeneralOde ti u javnostmemberPredrag Tomasevic19 Jan '09 - 10:45 
Poruke (a i clanak) nisu bile javne... a sve sto od sad pa nadalje pisemo ce ostati generacijama u amanet (osim ako neko od nas ne obrise).
 
Imas kod slika jos neka mesta gde nije ubacen <br />... pretrazi clanak za ". You can optionally modify your project" pa ces da vidis. Ali da ne sitnicarimo (ono dodaj border 1 na slicice, napravi malo mesta izmedju njih i teksta... verovatno te mrzi da to doterujes)... clanak je sada javno vidljiv.
 
A za to da je kodiranje isplativije od pevaljki - sto rece onaj ludak iz Suntavila -> "Klintone, nema sanse" Smile | :)
 
Dobar clanak by the way... dobio si 5 od mene.
GeneralRe: Ode ti u javnostmemberSasa Popovic19 Jan '09 - 11:07 
Predrag,
 
I'll write in English as this is an international website.
 
Thank you for all the useful comments. I'll try to make the article more readable in next few days.
 
Thx for the excellent mark Smile | :)
 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 19 Jan 2009
Article Copyright 2009 by Sasa Popovic
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid