Answered convert web part to be upload

  • Sunday, April 29, 2012 3:56 PM
     
     

    i have rent a sharepoint web site in the internet from apps4rent.com i did install sharepoint server and visual studio2010 in my machine now i developed a small app as visual
    web part what i want is to move this web part from my local sharepoint to my sharepint site is there a way to convert this project from all of those files to single webpart file to be upload to my site
    please i need your help
    • Edited by Mohi12 Sunday, April 29, 2012 3:58 PM
    •  

All Replies

  • Sunday, April 29, 2012 6:18 PM
     
     

    What kind of a webpart have you built?

    If it is a .webpart or a .dwp file, which has XSLT loaded to read items --  fine you can upload your webpart.

    But if you have built a dll , user control these needs to be copied on to the server to their respective locations and a safe control entry need to be made in the web.config file.

    So please let know what kind of a webpart file it is.. how you have built it may be that will be helpful to answer your question.

    Thanks.


    Sreeharsha Alagani | MCTS Sharepoint 2010 | Linkedin | Blog

  • Sunday, April 29, 2012 7:20 PM
     
      Has Code

    Hi.

    Build and package the solution in Visual Studio. This will result in a .wsp file in your projects debug folder.
    This file can then be added as a solution and deployed using PowerShell:

    'Add-SPSolution -LiteralPath <SolutionPath>'
    Add-SPSolution -LiteralPath c:\solutions\ProjectName.wsp
    'Install-SPSolution -Identity <SolutionName> -WebApplication <URLname>'
    Install-SPSolution -Identity ProjectName.wsp -WebApplication http://www.company.com
    

    You can also upload the wsp to your sites solution gallery and activate it there to make it available.

    Hope this answers your question.

    Regards


    Thomas Balkeståhl - Technical Specialist - SharePoint - http://blog.blksthl.com
    Download the SharePoint Branding Project here

  • Sunday, April 29, 2012 7:28 PM
     
     

    i build my web part by going to visual studio 2010 and create new project -> sharepoint 2010--> visual web part it open new blank web part i developed it then run it it works fine but i want to uplaod it in my sharepoint web site whlte it contains many files what i want to do is merge all those files to wepart file

    this is my project files that i want to convert it to webpart format to be loaded to my sharepoint site

  • Sunday, April 29, 2012 7:29 PM
     
     

    could you please explain more and give me step by step please because it only except .dep or .webpart as showen


    • Edited by Mohi12 Sunday, April 29, 2012 8:02 PM
    • Edited by Mohi12 Sunday, April 29, 2012 8:22 PM
    •  
  • Sunday, April 29, 2012 8:26 PM
     
     

     I want to convert the following files shown on the picture to .dwp or .webpart to upload it and use it in my web site

  • Monday, April 30, 2012 2:53 AM
     
     

    Hi Mohi,

    Your .webpart or .dwp file is represented in XML format. Right click and open it to see in a note page. Yow will be able to understand that it refers to an assembly because you are using a visual webpart and code.

    I dont think you can wrap all your files into a .webpart file.

    The only way is to deploy all your files to server or create a webpart file using just xml. which has XSLT in it.

    If you have sharepoint designer and have write access the sharepoint application your job is much easier. Can you lets us know what is the requirement, what data are you trying to show on your webpart.?

    Sreeharsha Alagani | MCTS Sharepoint 2010 | Linkedin | Blog

  • Monday, April 30, 2012 5:16 AM
     
     

    Hello Sreeharsha

    if i cant merge them in one file how can i use this developed visual webpart in my sharepoint site 

  • Monday, April 30, 2012 5:34 AM
     
     

    Hi Once you have built your project, right click the package and select Build Package. The package file is with the extension .wsp. This will get stored in the Bin folder of the project.

    Once the wsp is ready, take the file, and deploy it on the server using stsadm commands.

    Here are the commands to deploy your solution.

    Add Solution

    Deploy solution

    Once deployed activate the feature on the scope where you set for the feature while building a package. You should be able to find and add the webpart on the page. Let me know if you need more info on this.


    Sreeharsha Alagani | MCTS Sharepoint 2010 | Linkedin | Blog

  • Monday, April 30, 2012 5:36 AM
     
     

    Hi.

    Can you at least try my suggestion?
    On your project in VS, right click and select Package.
    Then, in the project folder, in your case the VisualWebPartProject5, check in the \Bin\Debug folder.
    In there you will find a VisualWebPartProject5.wsp file.
    This is a deployable SharePoint solution file. Use this and either upload it to the sites solution gallery or use the powershell code I gave you.

    Good luck.

    Regards


    Thomas Balkeståhl - Technical Specialist - SharePoint - http://blog.blksthl.com
    Download the SharePoint Branding Project here

  • Monday, April 30, 2012 7:06 AM
     
      Has Code


    Hi Thomas

    Thank you very much for your help

    i did the first step  fine (Add-SPSolution -LiteralPath c:\solutions\ProjectName.wsp)

    but this did not work with me(Install-SPSolution- Identity ProjectName.wsp -WebApplication http://www.company.com)


    so for the first step what happen??

    in the second solution it seems to install the web part to my web site directly

    if so what can i do to add this web part manually using sharepoint administrator or using sharepoint designer

    because i do not think that my website support install-spsolution with SharePoint Foundation 2010 Plan

  • Monday, April 30, 2012 7:22 AM
     
     

    Hi.

    If Add worked, then check in CA and Farm solutions, there you should see it. If you see it there, you can deploy it(same as install with PS) It all depends as well on what type of scope you have set fro your solution in VS. If it is farm, site or web...

    Regards


    Thomas Balkeståhl - Technical Specialist - SharePoint - http://blog.blksthl.com
    Download the SharePoint Branding Project here

  • Monday, April 30, 2012 7:25 AM
     
     

    Set the scope by double clicking on the feature in the solution explorer in VS.

    Regards


    Thomas Balkeståhl - Technical Specialist - SharePoint - http://blog.blksthl.com
    Download the SharePoint Branding Project here

  • Monday, April 30, 2012 8:01 AM
     
     

    Hi Thomas

    I found it in farm solution and i deployed it now how can i add it as web part ??

    another question is  SharePoint Foundation 2010 Plan support this ???


  • Monday, April 30, 2012 8:11 AM
     
     Answered

    Hi.

    Yes, Server and Foundation both support Visual Webparts and the same procedures to deploy them.

    See:
    Create Visual Web Parts for SharePoint 2010
    http://msdn.microsoft.com/en-us/library/ff597539.aspx

    Regards


    Thomas Balkeståhl - Technical Specialist - SharePoint - http://blog.blksthl.com
    Download the SharePoint Branding Project here

  • Monday, April 30, 2012 8:18 AM
     
     Answered

    And to answer your first question, once deployed, the WebPart will show up in the add web part dialog, under custom.

    Regards


    Thomas Balkeståhl - Technical Specialist - SharePoint - http://blog.blksthl.com
    Download the SharePoint Branding Project here