

AssemblyOriginatorKeyFile Property

Visual Studio .NET 2003

Returns or sets the name of the file containing the originator key for signing a COM wrapper assembly. The originator key is the public part of the public/private cryptographic key pair required to form a strong name. This property is only meaningful in Visual C# projects.

[Visual Basic .NET]
Public Property AssemblyOriginatorKeyFile() As String
[Visual Basic 6]
Property Get AssemblyOriginatorKeyFile() As String
Property Let AssemblyOriginatorKeyFile( _
   ByVal NewValue As String _
HRESULT __stdcall get_AssemblyOriginatorKeyFile(
   /* [out, retval] */ BSTR* retVal
HRESULT __stdcall put_AssemblyOriginatorKeyFile(
   /* [in] */ BSTR NewValue
string AssemblyOriginatorKeyFile {get; set;}
[JScript .NET]
public function get AssemblyOriginatorKeyFile() : String
public function set AssemblyOriginatorKeyFile(
   NewValue : String


A string specifying the path and file name of the file containing the originator key, relative to the project directory (see LocalPath Property).


A strong name consists of the assembly's identity — its simple text name, version number, and culture information (if provided) — plus a public key and a digital signature. The public/private key pair, used to create the digital signature, may be stored in a file or in a container in the Cryptographic Service Provider (CSP). The Strong Name Tool (Sn.exe) creates the file or container. The file name is specified by the user when running the tool and that same name is used in this property. For more information, see Strong-Named Assemblies.

A cryptographic service provider is an independent software module that performs cryptography algorithms for authentication, encoding, and encryption. For more information, see Microsoft Cryptographic Service Providers.

If your project creates a COM wrapper assembly, you can use the AssemblyOriginatorKeyFile, AssemblyKeyContainerName, and DelaySign properties to sign the assembly. If both the AssemblyOriginatorKeyFile property and AssemblyKeyContainerName property exist, and the container name is found in the CSP, then the assembly is signed using the container. Otherwise, the key file is used to sign the assembly.

The project system will automatically generate COM wrapper assemblies if your project contains references to COM components. For more information, see COM Interop Wrapper Error.

For information on signing the main assembly, see Global Attributes (Visual C#) and Global Attributes (Visual Basic).


' Macro Editor
' Set the strong name properties for COM wrapper.
Sub SetUpKeys(ByVal projectProps As EnvDTE.Properties, _
   Optional ByVal delaySign As Boolean = False, _
   Optional ByVal keyFile As String = "", _
   Optional ByVal container As String = "")

   Dim delaySignProp As EnvDTE.Property = projectProps.Item("DelaySign")
   Dim keyFileProp As EnvDTE.Property = _
   Dim containerProp As EnvDTE.Property = _
   keyFileProp.Value = keyFile
   containerProp.Value = container
   delaySignProp.Value = delaySign
End Sub

See Also

Assembly Manifest | Imported Library Conversion | AssemblyKeyContainerName Property | Strong Name Tool (Sn.exe) | General, Common Properties, <Projectname> Property Pages Dialog Box

Applies To: Properties Property (General Extensibility) | Properties Property (Visual Basic and Visual C# Project Object)

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft