1. Open an existing SharePoint solution in Visual Studio, or create a new Empty SharePoint Solution (click here for details).

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

  1. Two assemblies are added to the “References” folder if they do not already exist:  System.Web, System.Web.Extensions.
  2. A feature, named Feature1, gets added to the project, within the “Features” folder. It consists of a few items:
    • A folder, whose name determines the name of the feature within Visual Studio. The default name will be “Feature1”. You should select the folder and press the “F2” key to give it a more descriptive name.
    • A .feature file. This can be used to specify several properties of the feature

When you build the sandboxed solution, Visual Studio compiles the project into a .dll file and places it in the bin/Debug folder within the location that you specified in step 1, at the very beginning of this article.  

When you package the sandboxed solution, Visual Studio compiles the project into a .wsp file and places it in the bin/Debug folder within the location that you specified in step 1, at the very beginning of this article. Visual studio also creates a “manifest.xml” file based on the “Manifest” view of Feature1.feature file in Visual Studio. The “manifest.xml” file specifies that the feature would be deployed if it was converto to a farm solution (the GAC, the “safeControls” section of the web.config, and the Features” folder within the 14 hive). The “manifest.xml” file is located nested within the “pkg” folder in the solution folder on the file system.

When you deploy the sandboxed solution, Visual Studio stores the feature in the content database. The feature is now visible and activated Features Gallery of the website specified in step 1 at the very beginning of this aritcle.

Advertisements