How to deploy a particular visual webpart on a sharepoint site - sharepoint

I have created a sharepoint empty application in visual studio 2012, after that i have added 2 different visual web part and created one list through code.
when i click the deploy button, all the above 3 are deployed to the site.
i dont want this, i want only one particular visual webpart to be deployed to the site.
Thanks in advance

Remove the visual webpart from the project and then deploy the solution.

Related

how to convert asp.net website project to sharepoint wsp

I have created a Visual studio 2012 asp.net project on my local machine and now want to use in other sharepoint site.
How to convert my asp.net project to wsp file and to deploy to sharepoint environment.
You cannot automatically convert asp.net project to wsp file!
You need to adjust and change your asp.net code manually so it can be deployed to SharePoint and there is a lot to consider depending on your asp.net Projects functionality and structure - wsp (full trust code with c#) vs add-in (clientside code with JavaScript and REST).
Start here at MSDN: SharePoint general development
If you use the new SharePoint Framework (SPFx) to develop your client-side webparts, then you don't need a Visual Studio installed on a SharePoint server. You don't even need a SharePoint server.
Using SPFx you can develop in Notepad or any other code editor.
Note that SPFx is currently (Dec 13 2016) in preview.
Start here at Office Dev Center: Overview of SharePoint Framework (SPFx)

How to upgrade a SharePoint 2010 Project to SharePoint 2013 (WebParts, MasterPage, App Page, User Controls) in Visual Studio 2012?

We have a SharePoint 2010 project solution which we are trying to uprgade to SharePoint 2013. This includes webparts, application pages, user controls, masterpage, etc.
Foll. is the procedure we follow, please add to it/comment if we have missed out anything:-
Open your project solution file by right clicking and choose open with VS2012.
Edit your .csproj file and add to it -> <TargetOfficeVersion>15.0</TargetOfficeVersion>
Go to VS2012 and reload you project, Go to project properties and set framework as 4.5
Go to package and under properties of the package set the version to 15.0
Do a find replace for 14.0.0.0 to 15.0.0.0.
Check each file to do a check for any hive references. You'll need to add a /15/ to these. EG: _layouts/ to _layouts/15/ and also for CONTROLTEMPLATES
For master page project make sure you copy paste the SP2013 seattle masterpage from Designer and use it in VS project.
If you are using AJAX control toolkit then make sure you use version 3.0.30930.28736 as this worked well. If we tried using AJAX version 4.5 then the webparts do not work when deployed.
Do right click on project and Click Clean to clean solution
Build the solution, then Deploy your projects.
Please add to this if there are more points to be considered. Thanks.

Develop Visual Web Part Without Installing Sharepoint

I want to know if it is possible to develop web parts without installing sharepoint?
I choose Visual Web Part then I get sharepoint not installed error.
You can't develop it without SharePoint on same machine.
The answer is "Yes", you can. But if you do that then you loose all features of Visual Studio for development for SharePoint. You will need to create proper visual web part project artifact structure manually which could be tricky. Also you will have to create wsp package manually or using tools like wsp builder. Then you can copy this wsp package to sharepoint server and deploy it.

WSPBuilder for vs 2012

I am new to SharePoint 2013. I am using trial version vs 2012. I want to use the WSPBuilder to develop the web parts. I have install the WSPBuilder and it is not showing in vs 2012.
I have used the below link but not solved the issue.
http://gblsharepoint.blogspot.in/2013/01/using-wspbuilder-with-visual-studio-2012.htm
I have done the copy and past the "Microsoft Visual Studio" and "Microsoft Visual Studio Macros" hot applications and given the version as "11.0". It is working.
Can any one help me
WSP Builder had it's use back in the SharePoint 2007 days, where Visual Studio had no support for SharePoint packages.
Ever since the release of Visual Studio 2010 and Visual Studio 2012 there is no real need for WSP Builder anymore.
In order to use Visual Studio 2012 with SharePoint 2013 you will have to install an additional package though. To install it, launch the Web Platform Installer (or download the installer if it's not on your server from http://www.microsoft.com/web/downloads/platform.aspx). In the installer, search for SharePoint. From the results, install Microsoft Office Developer Tools for Visual Studio 2012.
Launch Visual Studio and when you create a new project/solution you should see a Office/SharePoint category. Underneath there, pick the SharePoint Solutions category. If you just want to create a single webpart in a WSP file, then the easiest is to pick the "SharePoint 2013 - Visual Web Part" project item. That will set you with a project containing a feature, a visual webpart that you can extend with your own code, etc. Build the webpart and you will end up with a WSP file in your debug/release folders that you can deploy to your server (or by simply pressing F5 it will automatically deploy it to the farm / site you specified when creating the project).
If you use F5 to deploy, don't forget to add the webpart to a page after deployment as Visual Studio will not do that for you (Edit a page, switch to the insert tab in the ribbon, pick your webpart. Your webpart will be under the 'custom' category if you don't modify the elements.xml file of the webpart).

Loading a Windows Azure Project from Gallery into Visual Studio 2012

I have a Windows Azure web site. I started this web site as a New -> Compute -> Web Site -> From Gallery. Once here, I chose the Orchard CMS. I have the site successfully running in Windows Azure. My challenge is, I want to do some customizations to it.
How do I get this code into my local Visual Studio 2012 instance so that I can:
Make customizations to the site with Visual Studio 2012.
Check it into source control so other on my team can work on it
I saw the following post: http://www.davidhayden.me/blog/installing-orchard-cms-as-an-azure-web-site. However, this only talks about opening the site in WebMatrix. I want to skip WebMatrix and go straight to Visual Studio if possible.
Download WebMatrix and click the Visual Studio button in the ribbon. It must create a solution file for you to then access your website via Visual Studio. I don't have an Azure website at the moment to try it with.
You may need to tweak the registry to get the VS 2012 to open properly:
Type regedit and select the HKEY_CLASSES_ROOT.
Locate VisualStudio.DTE and change the CurVer to
VisualStudio.DTE.11.0
Finally change the CLSID to {059618E6-4639-4D1A-A248-1384E368D5C3}
You do not need to use WebMatrix at all; another option is to just download the files from FTP and then create a VS solution and add the files you downloaded.
From Visual Studio you can easily deploy the solution to TFS and to your azure website.
As a side note, as of today (January 28th, 2014) the registry edit proposed by SilverNinja is no longer needed, I was able to open VS 2013 Professional from Webmatrix without editing the registry.

Resources