Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

c# vs2013 corrupt .dll

Posted on 2016-09-04
4
Medium Priority
?
81 Views
Last Modified: 2016-09-06
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)?
0
Comment
Question by:jetbet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 1

Expert Comment

by:Stefan Hoffmann
ID: 41785065
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?
0
 

Author Comment

by:jetbet
ID: 41785363
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?
0
 
LVL 1

Accepted Solution

by:
Stefan Hoffmann earned 2000 total points
ID: 41785565
Since I do not know about how you changed the code, I do not know if your application is compatible with your new dll or not. If the dll and the application depend on each other (share an interface) I'd include them into one solution in Visual Studio. Thus I never deploy a version of a dll without having built it with the application. I did not try this out yet. It should work if you do not change any parameters.

I have the following ideas that may help you:

How To find the version number:
You find the information about the version number in the file version information using explorer. Just go to the file, right click it, go to properties->details and take a look at the version number. Since you have the source of the dll file, you could change the version number there slightly so you can see the difference.

ildasm:
Another approach would be using ildasm to verify the contents of the dll and your application.
https://msdn.microsoft.com/de-de/library/f7dy01k1(v=vs.110).aspx
Here you can have a look at the compiled code directly, so you can see if the changes are in fact part of the content or if you have been tricked by some deployment issue.
There are .Net decompilers available that may be of even more help, since they can show you a c# source code derived from the compiled stuff.

Delete-It-Test:
To be certain that you do not by accident load a different version of the dll you could delete the dll from the directory and start the application. If it starts you know this may be not the version that is loaded after all. Then checking the GAC is highly recommended. Because it probably contains the version that is loaded then.

Different .Net Framework Versions of the library and the application?
You may run into weird issues if the library and the application are compiled for different .net versions.

Copy distribution works mostly fine with .Net Applications. I only once ran into a problem where the .Net Frameworks differed between development and production machine because one of the machines had all windows updates installed and the other one nearly none and somehow some method had been changed in the .Net Framework.

Let me know what you find.
0
 

Author Closing Comment

by:jetbet
ID: 41787153
Thanks for your help.

It looks as though I need to recompile the application if I want to change the .dll version
0

Featured Post

Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question