Show / Hide Table of Contents

Method GetAssemblyData

| Improve this Doc View Source

GetAssemblyData(Assembly)

Gets the data for the specified calling assembly.

Declaration
public static string GetAssemblyData(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The specified calling assembly.

Returns
Type Description
System.String

langword_csharp_string represents the calling assembly.

Remarks

When publishing an AssemblyLicense, the Data property should be set as the string value returned by AssemblyLicense.GetAssemblyData, otherwise the validation will always fail.

The returned data is formated as "[AssemblyName],[PublicKeyToken]" if the assembly is signed with a strong name, or "[AssemblyName]:[AssemblyHash]" if the assembly is not signed. When assembly is not signed, every compile may result in a different assembly hash, therefore a different AssemblyLicense is required.

| Improve this Doc View Source

GetAssemblyData(String)

Gets the data for the specified calling assembly file.

Declaration
public static string GetAssemblyData(string assemblyFile)
Parameters
Type Name Description
System.String assemblyFile

The path of the calling assembly file.

Returns
Type Description
System.String

langword_csharp_string represents the calling assembly file.

Remarks

When publishing an AssemblyLicense, the Data property should be set as the string value returned by AssemblyLicense.GetAssemblyData, otherwise the validation will always fail.

The returned data is formated as "[AssemblyName],[PublicKeyToken]" if the assembly is signed with a strong name, or "[AssemblyName]:[AssemblyHash]" if the assembly is not signed. When assembly is not signed, every compile may result in a different assembly hash, therefore a different AssemblyLicense is required.

  • Improve this Doc
  • View Source
Back to top Copyright © Weifen Luo | DevZest