I'm new to .net and might not have understood the concepts completely. I know this a pretty old question but couldn't find an appropriate answer for it and I need help.
We have a 3rd party project(lets call it "Record" for understanding) to manage all the records. My goal to create a small windows form project which uses the dll's(13 in count, most of them are dependent without which the application will not execute) from that Record project's bin. Since the Record project gets updated every now and then, i should not retain a local copy of those dll's in my project's bin. I'm consuming classes(class as types), methods and models from only 2 dll's so i added the remaining dynamically using ImportDll.
I tried the following:
1. I added reference to those dll's directly from the record project's
location (C:\Program Files\Records) but when i build, a local copy is made
to my project's bin folder, so i set their copy local property to false. I
ended up getting an error stating "Assembly must be strong signed in
order to be marked as a prerequisite.
2. I tried to add the code base
<dependentAssembly>
<assemblyIdentity name="xyz" culture="neutral" publicKeyToken="null" />
<codeBase href="FILE://C:/Program Files/Records/xyz.dll"/>
</dependentAssembly>
I'm getting an exception " Could not load file or assembly 'xyz,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=null' or one of
its dependencies. The private assembly was located outside the
appbase directory. (Exception from HRESULT: 0x80131041)" I did not
give the version coz, it will get updated frequently.
3. Tried giving the probe path too . but it doesn't work.
4. Added the reference path as per `https://msdn.microsoft.com/en-us/library/6taasyc6(v=vs.100).aspx`.
But my methods and models are not getting identified.
5. Tried to load as per `https://www.chilkatsoft.com/p/p_502.asp`
got an error stating the assemble name was not strong.
I cannot use GAC as the dll's are updated by the 3rd party.
I'm not sure whether i'm doing it right. Can someone direct me in the correct way to reference those 2 dll's directly from the Record project's bin both at runtime(even after deploying) and compile time without having a local copy and be able to utilize the classes and methods? I hope i have explained all. If I'm not clear please let me know..
User contributions licensed under CC BY-SA 3.0