Get Public Key Token for Assembly in Visual Studio

In Visual Studio Click Tools > External Tools > Add and enter the following:

GetPublicKey

Command: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\sn.exe
Arguments: -T $(TargetPath)

Note: The path for the command can be different depending on you Visual Studio version. Just check in your file directory where the sn.exe is (might be v6.0A instead of v7.0A).

Error occurred in deployment step ‘Install app for SharePoint’: The provided App differs from another App with the same version and product ID

Problem:
Cannot deploy a solution and getting the error: Error occurred in deployment step ‘Install app for SharePoint’: The provided App differs from another App with the same version and product ID.

Solution:
Open the AppManifest.xml in code view and generate a new guid for the app -> Change value of ProductID.

Add URLs to Hyperlinks-List via XML or C#

ListInstance Elements.xml

<Data>
   <Rows>
      <Row>
         <Field Name=”URL”>www.google.de, Google</Field>
      </Row>
   </Rows>
</Data>

Note:

  • Webrelative URLs are not working here, only full or serverrelativ URLs are possible!
  • Don’t forget the space after the comma
  • C# – via Feature EventReceiver

    using (SPWeb web = properties.Feature.Parent as SPWeb)
    
    {
    SPList list = web.Lists["Links"];
    SPListItem newItem = list.Items.Add();
    string name = “Google”;
    string url = “www.google.de”
    newItem["URL"] = url + “, ” + name;
    newItem.Update();
    }
    

    Note:

  • All types of URLs are possible, for example you can set up the URL using web.ServerRelativeUrl.
  • Error “An unhandled exception occurred in the Silverlight Application” when creating a new site via Silverlight interface

    If you get the above error when creating a new site via the Silverlight interface, here’s what should fix the error:

    Go to Central Admin, klick “Manage Web Applications”, choose “General Settings” and check if Security Validation is turned off. Turn it on!

    securityValidation

    You will now be able to create sites using the Silverlight interface again.