none
Get data from assembly with write sharing of it. RRS feed

  • Question

  • Hello! I want to get some data from assembly without blocking on writing. I need the most simple and the most efficient method. I can keep that data almost everywhere but i'd like to hide it from everyone. I'd like to use method like this - http://msdn.microsoft.com/en-us/library/system.diagnostics.fileversioninfo.aspx

    But it's visible information. Maybe i can use Win32 resources for that?

    Thanks.

    Monday, December 12, 2011 3:13 PM

All replies

  • Hi,

     

    Welcome to the MSDN forum.

     

    According to your description, I do not understand your requirement clearly.

    You want to get data from assembly. -- Do you mean a class or a property of a class? When we load an assembly, we need to create instances of types that are found in the assembly to use them. Or in fact, you just want to get information about the assembly, e.g. assembly version.

     

    "I can keep that data almost everywhere but i'd like to hide it from everyone."-- I do not understand what you mean. Could you please describe it more clearly?

     

    Thanks for your posting and understanding.

    Have a nice day.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Tuesday, December 13, 2011 8:54 AM
  • Not class or property. For instance string value but i think that may be something else like binary data. All that we can put in resources.

    It'll be very convenient if we can get some data without assembly loading and of course without blocking of assembly.

    • Edited by Booster1 Tuesday, December 13, 2011 9:26 AM
    Tuesday, December 13, 2011 9:06 AM
  • Loading it via Reflection with Shadow Files, that should do your thing.
    Regards, MusicDemon
    Tuesday, December 13, 2011 9:49 AM
  • It's very complicated and isn't efficient. I need light method.
    Tuesday, December 13, 2011 10:28 AM
  • Hi,

    I'm afraid that it is necessary to load the assembly if we want to get assembly information or get data resource from the assembly.

    Here is a good example to get information from assembly:

    http://assemblyinformation.codeplex.com/

    After loading the assembly, you can use ResourceManager Class to get resource. Here is a code project:

    http://www.codeproject.com/KB/cs/cs-multi-assembly-res.aspx


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Wednesday, December 14, 2011 9:21 AM
  • It's very inconvenient if we need exclusive access for that. As i was saying earlier we can do it via System.Diagnostics.FileVersionInfo. But that method has own inconvenience too because we need place our information to the inappropriate place. But if there isn't any better method then load assembly after that unload it via domain that may be i will use particularly this method. "Shadow File" is very similar method. By the way we still need delete domain.
    Wednesday, December 14, 2011 10:06 AM