1. Open Visual Studio (Start -> All Programs -> Miscrosoft Visual Studio -> Miscrosoft Visual Studio)
  2. File -> New -> Project
  3. In the “Installed Templates” section, open the following nodes: Visual C# -> SharePoint -> 2010
  4. Click on “Empty SharePoint Project” in the top center of the window.
  5. Select “Create directory for solution” at the bottom right of the window.
  6. Specify a name in the “Name:” textbox at the bottom of the window.
  7. Click “Browse” at the bottom right of the window then select a location for your solution to be saved.
  8. Click “OK” at the bottom right of the window.
  9. Enter the URL of a SharePoint site, from your local server, in the “What local site do you want to use for debugging” drop down list. This tells Visual Studio which w3wp.exe process to attach to for debugging.
  10. Select one of the radio buttons to specify a sandboxed or farm solution. You should alway choose a sanboxed solution if possible. You can alway change the trust level of the solution later, if needed (click here for details).
  11. Click “Finish” !

By default, Visual Studio will create several files and folders within the solution. Keep reading if you would like to have a basic understanding of what they do.

  1. A solution file with the name you specified in step 6, above. The file specifies the startup project, incase you plan to add more projects to the solution.
  2. A project file with the name you specified in step 6, above. The file specifies:
    • Active Deployment Configuration – Choose “No Activiation” if you want features within the project to be deployed to the features gallery, but not activated.
    • Assembly Deployment Target – Choose “GlobalAssemblyCache” if you want the .dll to be deployed to C:\Windows\assembly. Choose “WebApplication” if you only wish for the .dll file to be added to the bin\Debug folder within the location that you specified in step 7, above.
    • Include Assembly in Package – Choose “False” if you do not want Visual Studio to automatically insert a SafeControl tag, for each WebPart/Control in the assembly, into the web.config file.
    • Sandboxed Solution – Choose “False” if you want to deploy the solution in Farm mode. This is not preferable for security and maintenance reasons.
    • Startup Item – Specifies which item in the project will be selected when debugging starts. Default value is “(none)”, and that is the best choice in most instances.
  3. A “Properties” folder, within the project. This contains a file named “AssemblyInfo.cs”. The file specifies properties, such as title and version number, which will be attached to the .dll file when you build the solution.
  4. A “References” folder, within the project. This folder contains .dll assembly files that are commonly utilized in SharePoint projects. 
  5. A “Features” folder, within the project. This folder is empty by default, but you can manually add features by right clicking and choosing the menu options. You can add a Features Gallery image/icon to an existing feature (click here for directions).
  6. A “Package” folder, within the project. This folder contains a .xml file which specifies where the .wsp will deploy project files. (somewhere within C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE)
  7. A key.snk file, within the project. This is a Strongly Named Key file. It is required in order to deploy a .dll assembly to the GAC.  
Advertisements