Today i am going to show you a problem solving issue, generally we use to create an separate assemblies (i.e, dll’s) and reference them to the main application in this process most common issue is we have coded a logic in our dll but its not applied/running through main application… as many people ask me how to fix this issue due to this reason i may posting this… the issue is simple and cause of issue may be of two reasons those are:
- Your dll may not updated in you main application.
- You may coded in one location and referring from other location in your main Application.
These two are most common issues, the first will be raised if you are manually copy the dll from the bin folder of you
component project to your main application bin folder. If you do like this every time you change your component you need to repeat this process, if you forgot to update the above issue will occur.. for this a better option is to while adding reference to you component select the component project instead of selecting a dll in your bin folder this will
automatically updates your component dll in your main application’s bin folder whenever a change is done this way we can fix the 1st cause of issue.
Second cause is straight forward and most people suffers with this kind of issue, to fix this issue we need to know from where the respective component is picking by the CLR.. we can do this using Modules window in visual studio 2010.
To open this window go to Debug->Windows->Modules as shown below.
Note: This will be visible while running the application.
Now you will see the below window with grid of Assemblies loaded
In this window you can find all the information regarding your component from where it is loaded and etc.., using this we can fix another issue too as many people cannot debug their components in the main application the reason for this is your main application doesn’t have the respective components symbol file i.e.., .pdb file and in this modules window you can find is the CLR picks its symbol file or not.. if not just copy the latest one in to your main application’s bin folder and build and restart the application.
That’s it …… Have an Happy Coding 🙂