none
Loading a refrence assembly RRS feed

  • Question

  • Hi all

    I have a reference assembly

    this I have added via the Refrences in to the project.

    I can load or refrence this assembly via:

    Assembly assembly = Assembly.LoadFile(@"C:\bin\Deployment\SampleSchemas.dll");

    This works fine..

    Now I need not to load it from file but rather refrence the one in the refrence..

    I have added it via Project properties Resources.. but I am not able to  assign it or refrence it..

    Any Idea how I might perform this function below. ?

    Assembly assembly = Assembly.LoadFrom("SampleSchemas.dll");

    Thanks in Advance


    AKE

    Thursday, August 1, 2013 2:25 PM

Answers

  • I understand what you want to achieve but I don't think it is possible as the project reference is a build time load and the Assembly.LoadFile is a runtime load.  In other words, I would make the reference copy local and then use LoadFile to reference the location the library will be saved (e.g., /bin for a webapp). 

    Jeff

    Thursday, August 1, 2013 8:49 PM