Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I got an issue where i am trying to load a dll which is created in vs2005 into vs2008.I am getting an issue in versions.The compiler looks for version 1.0.0.0 but the version i am passing is 1.0.1578.31812 which is causing an issue.Please help me how to change the version of dll.
Thanks,
Kiran
Posted

You need to update the version information in the AssemblyInfo.cs file of the project. You can also just change the reference to the assembly to not be "Specific Version". Either of these would solve your problem.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 8-Jul-11 11:08am    
Well, all correct, 5, but it looks like you advice in assumption that the source code is available. If source code of both assemblies is available, there is a better way.

Please see my solution.
--SA
Andrew Rissing 8-Jul-11 15:02pm    
Right, if he has the source to the referenced assembly, he can just update the AssemblyInfo.cs there. If he didn't, he could as easily change the reference in his project to not care about the specific version.

I assumed the latter was the once most likely to resolve his issue, unless he has an overly complex setup.
I hope you have source code for you referenced assembly. Do you have the source code of referencing assembly? If you have both, there are a better way.

Put both projects in a single assembly. Reference one project in another one using "Add references" but by project. Use "Projects" tab in the windows with references list. In this way, the match between the required version in the referenced assembly and actually version of referencing assembly will be updated automatically as you build. When you change any version of the assembly, not matching updated in source code is needed — everything will be automatically done during build. During run-time, however, strict dependency on concrete version will be maintained. Therefore, do not use non-specific version.

A side advice: always sign your assemblies. It's easy to do it in the very beginning and is a very valuable feature. I don't have time to explain why. Read about strong names.

—SA
 
Share this answer
 
Comments
KiranKumar0407 11-Jul-11 6:07am    
Hi,
Thanks a lot for ur help.It's working.
Thanks,
Kiran
Sergey Alexandrovich Kryukov 11-Jul-11 10:47am    
Working now? Great! You're most welcome.
Good luck, call again.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900