I have created a library for use in some of my applications. It loads information into various classes in memory and keeps itself updated.
Recently I updated it due to a small issue. This went through developer and UAT testing without an issue.
There is an issue where it goes from working correctly to throwing an error that one of the fields on one of the classes does not exist. Needless to say this does exist and is initialized correctly.
Part of the investigation was to start an application that uses the .dll into Visual studio. I put a breakpoint at a point where a function is called that uses the field that I have the problems with but when the problem exists I cannot step into the function for some reason. If I check the object before the function is called I can also see the field that is supposedly missing.
This function is called often without an issue until this particular issue decides to show itself.
How could a compiled .dll seemingly change behaviour after it has been working correctly for hours and what would stop me stepping into the code that uses it (a few lines into the function)?
C#.NET Programming
Last Comment
jetbet
8/22/2022 - Mon
Stefan Hoffmann
I remember I had funny errors with libraries before, but that was a GAC issue. I had the same library (something.dll) in the same version (1.0.0.0) registered in the GAC and in the softwares directory. The version in the GAC is preferred, so when I changed the library and deployed the software I ran into problems because my changes did not apply. It took quite some time to find it.
Maybe it is something like that? Did you maybe register your library to the GAC?
jetbet
ASKER
What would be the best way to release a new version of my .dll to my target machines? In this instance I copied the existing folder, renamed it, and dropped the new .dll into it.
So do I also need to rebuild the Application that uses it (it resides in the same directory as the executable) and how can I look on the target machine to see what version (or path to it) that it is using?
Maybe it is something like that? Did you maybe register your library to the GAC?