merge from trunk at 97714
[mono.git] / mono / metadata / monosn.c
index 936b98e5f5d6d22dabff9de5ca40b5cc49408e2e..a4aeea3fe41633e46f97166d788b87b19545dc98 100644 (file)
@@ -68,6 +68,13 @@ show_token (const char *file, int is_assembly, int show_pubkey) {
                MonoImage *image;
                const char *pubkey;
                guint32 len;
+
+               mono_metadata_init ();
+        mono_raw_buffer_init ();
+        mono_images_init ();
+        mono_assemblies_init ();
+        mono_loader_init ();
+
                image = mono_image_open (file, NULL);
                if (!image) {
                        printf ("Cannot open image file: %s\n", file);
@@ -75,7 +82,7 @@ show_token (const char *file, int is_assembly, int show_pubkey) {
                }
                pubkey = mono_image_get_public_key (image, &len);
                if (!pubkey) {
-                       printf ("%s does not represent a strongly named assembly\n", image->name);
+                       printf ("%s does not represent a strongly named assembly\n", mono_image_get_name(image));
                        mono_image_close (image);
                        return 2;
                }
@@ -108,7 +115,7 @@ extract_data_to_file (int pubk, const char *assembly, const char *outfile) {
        else
                pubkey = mono_image_get_strong_name (image, &len);
        if (!pubkey) {
-               printf ("%s does not represent a strongly named assembly\n", image->name);
+               printf ("%s does not represent a strongly named assembly\n", mono_image_get_name(image));
                mono_image_close (image);
                return 2;
        }