View Full Version : strong named assembly
m.brandtner
07-08-2004, 02:56 PM
I do not get a strong named assembly although I provide my AssemblyInfo class (AssemblyInfo.f95) with a valid key. Are I am missing something?
thx markus
tzeis
07-08-2004, 06:00 PM
You need to provide the "AssemblyKeyFileAttribute" custom attribute along with the key file name in the source code (not in assemblyinfo.f95). For more information consult the online documentation. There is a section on strong name assemblies in the Fortran for .NET User Guide.
m.brandtner
07-08-2004, 06:55 PM
but the file AssemblyInfo.f95 has got exactly this information along with other attributes.
this file is part of my project.
***
module
!
! General Information about an assembly is controlled through the following
! set of attributes. Change these attribute values to modify the information
! associated with an assembly
!
!.nca assembly (add=System%Reflection%AssemblyTitleAttribute(USTR ING("")))
!.nca assembly (add=System%Reflection%AssemblyDescriptionAttribut e(USTRING("")))
!.nca assembly (add=System%Reflection%AssemblyConfigurationAttrib ute(USTRING("")))
!.nca assembly (add=System%Reflection%AssemblyCompanyAttribute(US TRING("")))
!.nca assembly (add=System%Reflection%AssemblyProductAttribute(US TRING("")))
!.nca assembly (add=System%Reflection%AssemblyCopyrightAttribute( USTRING("")))
!.nca assembly (add=System%Reflection%AssemblyTrademarkAttribute( USTRING("")))
!.nca assembly (add=System%Reflection%AssemblyCultureAttribute(US TRING("")))
!
! Version information for an assembly consists of the following four values
!
! Major Version
! Minor Version
! Build Number
! Revision
!
!.nca assembly (add=System%Reflection%AssemblyVersionAttribute(US TRING("1.0.0.1")))
!
! In order to sign your assembly, you must specify a key to use. Refer to the
! Microsoft .NET Framework documentation for more information on assembly signing.
!
! Use the attributes below to control which key is used for signing.
!
! Notes:
! (*) If no key is specified, the assembly is not signed.
! (*) KeyName refers to a key that has been installed in the Crypto Service
! Provider (CSP) on your machine. KeyFile refers to a file which contains
! a key.
! (*) If the KeyFile and the KeyName values are both specified, the
! following processing occurs:
! (1) If the KeyName can be found in the CSP, that key is used.
! (2) If the KeyName does not exist and the KeyFile does exist, the key
! in the KeyFile is installed into the CSP and used.
! (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
! When specifying the KeyFile, the location of the KeyFile should be
! relative to the project output directory which is
! %Project Directory%\obj\<configuration>. For example, if your KeyFile is
! located in the project directory, you would specify the AssemblyKeyFile
! attribute as "..\\..\\mykey.snk"
! (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
! documentation for more information on this.
!.nca assembly (add=System%Reflection%AssemblyDelaySignAttribute( .false._1))
!.nca assembly (add=System%Reflection%AssemblyKeyFileAttribute(US TRING("..\\..\\..\\Key\\TMKey.snk")))
!.nca assembly (add=System%Reflection%AssemblyKeyNameAttribute(US TRING("")))
end module
***
Is there any building option to set or something else? or do I have to place the attributes to an other source file?
thx markus
m.brandtner
07-12-2004, 02:13 PM
after gambling around with the attributes I have found out, that it does not depend on WHERE the attribute is definded it is simple the fact, that there MUST NOT be the attribute AssemblyKeyNameAttribute with a blank string. This will overwrite or ignore the AssemblyKeyFileAttribute. The file AssemlyInfo.f95 provided with your Pythagorean example does not work. If it would be ok in this way, the compiler should complain, that the key file is not present. if you comment out the last attribute, which is the AssemblyKeyNameAttribute, the compiler complains about the missing file. By the way: it is legal to define the AssemblyKeyNameAttribute in VS.Net projects with an empty string together with the AssemblyKeyFileAttribute.
with kind regards
markus
m.brandtner
07-12-2004, 03:44 PM
there is still one question left:
how can one define attributes in fixed source form (.f files)? it is apparent, that 72 columns are not enough space to define the attributes and continuation lines will not work. please can somebody tell me how to manage this.
thx markus
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.