none
How to change deploy server in visual studio 2010 for web part

    问题

  • Hello,

    I have a web part that I have been deploying to Server A. I now have a new SharePoint environment I would like to deploy my web part to (Server B). How can I set the web part solution to deploy to Server B rather than Server A?

    Thank you..


    Diddi

    2012年6月22日 17:38

答案

全部回复

  • If you are using Visual Studio to deploy, select the project in node in the solution explorer and press F4. You'll get the properties window where you can change the target deployment site URL.

    If not, use powershell or STSADM command for adding the solution and deploying the solution in the server.

    http://technet.microsoft.com/en-us/library/cc262995.aspx


    NLV - MCTS - Blog - Twitter - In

    2012年6月22日 18:12
  • Thanks For Reply,

    I tried to Deploy in another sharepoint server which is in another system.. i am getting below error

    "Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site: http://test.abc.com. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project"

    but i opened that site URL in internet Explorer its opening , its deploying in to my local sharepoint server not deploying to other system sharepoint server.

    Can you please suggets me what could be the problem.

    Thank you..


    Diddi

    2012年6月22日 18:44
  • I'm having the exact problem. I first thought it was because it was sandboxed soulution, so I recreated the solution as a farm solution, but I'm unable to deploy to another SP farm on another server.

    Any help on this would be much appreciated from me too.

    Ritz.


    Ritz

    2012年6月26日 8:50
  • Please check if the other server on which you want to deploy is accessible from your current server with full privileges.......

    More details will help us to answer your query.


    Success is a slow rider, it requires a lot of time, I need pace in life, so left success and moved ahead.

    2012年6月26日 8:55
  • Hello kamal,

    Thanks for your reply..

    The server on which I want to deploy is accessible from my current server with full privileges. I have all rights to create anything on that. but still getting this error while deploying

    "Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site:http://test.abc.com. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project"

    Can you please help me on this.

    Thank you..


    Diddi

    2012年6月27日 15:03
  • hi,

     you can go to the solution's  bin folder  and get the wsp and deploy in youe second server using STSADM or powershell commands.

    or you can use sharepoint installer from the codeplex community.

    HTH 


    PrasadWT

    2012年6月27日 16:36
  • I managed to resolve this by deploying the solution with PowerShell instead of the GUI. The following commands were used:

    1. Add-SPSolution "C:\temp\<solution name>.wsp"

    2. Install-SPSolution –Identity <solution name>.wsp –WebApplication http://<web application> -GACDeployment

     


    Ritz

    2012年6月27日 16:48
  • Hello,

    Please cross check if it is possible to deploy solution on the Server farm, I am not sure but perhaps you can deploy Solution to local machine only from VS 2010.

    Regards..............


    Success is a slow rider, it requires a lot of time, I need pace in life, so left success and moved ahead.

    2012年6月28日 4:16
  • Hi Diddi,

    Need one clarification. How you are deploying to server B? using visual studio or powershell?

    If it is visual studio, have you changed "SiteUrl" property for the webpart project in server B?(what NLV suggested)

    If it you are using power shell please check the below link.

    http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/12/02/adding-and-deploying-solutions-with-powershell-in-sharepoint-2010.aspx

    Hope this help!

    Regards,

    Kumar.






    2012年6月28日 10:39
  • Hello Kumar,

    Initially i tried to Deploy from GUI but now i am  deploying the solution with PowerShell

    When i execute this command

    Add-SPSolution "C:\temp\<solution name>.wsp"

    Getting error saying that "Add-SPSolution : Access Denied"

    Can you help me to resolve this problem..

    Thanks


    Diddi

    2012年6月28日 18:54
  • Didi,

    When you open PowerShell, make sure you right click and select 'run as administrator'


    Ritz


    • 已编辑 Ritz Patel 2012年6月28日 19:55 correct grammer
    2012年6月28日 19:23
  • Hi Diddi,

    Please copy the "wsp" file from "c:\temp\" to different location like D: or E: drive(Not sure this is exact problem). And try the same once again with powershell as "Run as administrator".

    And one more query, are you using "Windows Power Shell" or "SharePoint 2010 Management Shell"?

    Let me know if you face any issues.

    Regards,

    Kumar.


    2012年6月29日 6:23
  • Hi Diddi!!

    U need to go to IIS manager and recycle application pool and the restart iis.

    change deployment server url using F4 and specify the name of server url.

    if error is again there feel free to post!

    thanks

    Sudhanshu(Team Lead-HP)


    Thanks, Sudhanshu Shekhar(MCTS)

    2012年6月29日 7:55
  • Hey,

    Its Simple Fix :

    1] Open Visual Studio 2010

    2] Click the Solution Explorer --> right click the Project and choose Properties (in the Bottom )

    3] Click on the Build tab in the left

    4] See in "Platform Target"  Section

    5] Set it to the x64 or Any CPU...i think you have set it to x86.

    Then Deploy it.

    Hope it helps.

    Let me know if you have any queries :)


    "The Only Way To Get Smarter Is By Playing A Smarter Opponent"

    • 已标记为答案 Shimin Huang 2012年7月2日 15:06
    • 取消答案标记 diddi10 2012年7月3日 14:47
    2012年6月29日 8:24
  • Hello Kumar,

    Add-SPSolution is working for me ..

    But now when i execute Install-SPSolution –Identity PhysicianOnCallSheet.wsp –WebApplication http://test.abc.com/pages/test123.aspx -GACDeployment

    but getting this error "cannot find an spwebapplication object with name id or url"

    i just chcked "Get-SPWebApplication" i didnt see my Deploy server Url over here i can see my local system sharepoint url's.

    Even i tried to deploy from Central Administration -- System settings -> Manage farm solutions -> My Solution -> click on deploy the solution

    but i am unable to see the Deploy(test serever) server url overhere also..

    Can anybody help me on this..


    Diddi

    2012年7月2日 20:25
  • Hello Ravi,

    Thanks for your Reply.

    it was set to 'Any CPU' even i changed it to x64 and  tried to deploy from GUI but getting same error.

    Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site:http://test.abc.com. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project"

    Please can anyone suggest me what could be the problem.


    Diddi

    2012年7月2日 20:28
  • It looks like the test site is hosted on another server; it's not running on the machine you're using.  Grab the .wsp and the powershell script from a few posts up and run that on the actual test server.
    2012年7月2日 20:37
  • Thanks Everyone for your reply,

    I finally Deployed my webpart as

    1)Add-SPSolution C:\projects\bin\Debug\OnCallSheet.wsp

    2) I deployed this From central Administration --> System Settings -- Manage Farm Solutions

    oncallsheet.wsp               Deployed                   http://test.abc.com    

    But this webpart is not showing on my webpart galleries.    

    Did i miss anything else ?? Can you guys please help me to get my Custom webpart on my webpart galleries.

    Thanks,

               


    Diddi

    2012年7月3日 14:36
  • Hi Diddi,

    Did you also activate the Feature containing your Web Part? This needs to be done before it will appear in the UI :-)

    Cheers,

    Tobias.


    Tobias Zimmergren
    Microsoft MCP, MCTS, MCT, MVP (SharePoint)
    Blog: www.zimmergren.net
    Twitter: twitter.com/zimmergren
    Corporate site: www.tozit.com

    2012年7月3日 20:07
  • Diddi,

    I had the same problem and I solved it by adding it manually to the web part gallery.

    1. Go to site collection settings > galleries. Check if your web part is shown here

    2. if it is not shown here, select the documents tab and click on new document.

    3. You should now be shown the 'new web parts dialog page. Click on the check box for your web part and then click the populate gallery button to make it available.

    Hope this works for you.


    Ritz

    • 已建议为答案 Ritz Patel 2012年7月3日 22:27
    2012年7月3日 22:27
  • Hi Diddi,

    Go to Site Action->Site Settings->Site Collection Feature and Activate the Feature with the name of ur webPart,

    Then you can fing the webpart in webpart gallery


    Thanks, Sudhanshu Shekhar(MCTS)

    2012年7月4日 7:23
  • Thank you all..

    Now i am  able to see my webpart in webpart galleries.

    Thank you so much for all your replies..


    Diddi

    2012年7月5日 19:46