Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Load resource into assembly
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Load resource into assembly
Divers
Thread ID:
01007930
Message ID:
01007930
Vues:
58
I am trying to run some sample code but I am having some trouble loading a resource file (Level.bin) into the assembly so that I can extract data from the file at runtime using the code:
Stream stream = GetType().Assembly.GetManifestResourceStream("Level.bin");
Byte[] data = new Byte[stream.Length];
stream.Read(data, 0, (int) stream.Length);
An exception is caught on the 2nd line stating that object reference is not set to an instance of an object. The GetManifestResourceStream() method is not throwing an exception but it appears that there is never an object stream created.
I have added the file Level.bin to the project and set the build action to Embedded Resource.
Is there anything that I am missing?

Thanks,
Einar
Semper ubi sub ubi.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform