SharePoint Productivity Tip of the day

Posted on 12/6/2009 @ 5:01 PM in #SharePoint | 4 comments | 1234 views

This tip will make it easy for you to get that assembly name right within Visual Studio.
This applies to both SP2010 and SP2007.

  1. In Visual Studio, Go to Tools –>  External Tools.
  2. Click on “Add” to add a tool, and put in the following values:
    1. Title: S&trong Name
    2. Command: Powershell.exe
    3. Arguments: -command "[System.Reflection.AssemblyName]::GetAssemblyName(\"$(TargetPath)\").FullName"
    4. Check “Use Output Window”
    5. Uncheck everything else – here’s how it should look -

3. That’s it, now in your project, Visit Tools –> Strong Name, and in the output window, itwill give you the assembly name like this –>

SandBoxWebPartWithProxy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=64b818b3ff69ccfa


On 12/6/2009 10:29:54 PM Harish Mathanan said ..
Nice tip! thanks Sahil :)


On 2/23/2010 1:02:43 AM Venkatesh said ..
Hi,


In the command, when i give "Powershell.exe", I am getting error as "Command is not a valid executable".. How to correct this?


Thank you


On 7/18/2010 1:44:55 PM Andrew Vevers said ..
Hello

I am getting the error:

Exception calling "GetAssemblyName" with "1" argument(s): "The path is not of a


legal form."


At line:1 char:50


+ [System.Reflection.AssemblyName]::GetAssemblyName <<<< ("").FullName


+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException


+ FullyQualifiedErrorId : DotNetMethodException

- any ideas?


Am using it against a SharePoint 2010 solution.

Regards

Andrew


On 7/18/2010 10:12:12 PM Sahil Malik said ..
Is your project built yet Andrew?


Please post your comments:


Your feedback will be submitted for moderation, and will appear after it is approved.

Name:  
Email (optional): Your email address will not be posted.
URL (optional):
Comments: HTML will be ignored, URLs will be converted to hyperlinks  
Enter the text you see in the box: