1

I have a project which references another project's dll. They both were in .net framework 2.0.

So upgraded both to 3.5, but when I go to reference for second project(the one referencing the first project) it still says on properties runtime version 2.0, even though I deleted the reference and readded.

  1. How would I determine if the referenced dll is the upgraded one, before deploying to server where it has version 2.0?

  2. I don't want to delete all files in server and deploy, after upgrading do I need to check the config files are referencing same dlls and deploy published files or it needs replacing all together?

Zaki
  • 5,540
  • 7
  • 54
  • 91

3 Answers3

3

.Net 3.5 and .Net 2 both run on version 2 of the CLR, so the runtime version of the 'old' and 'upgraded' assemblies will not change.

As for finding out whether it is 'upgraded', I would recommend using ILDASM to see which version of mscorlib is referenced.

However, the answers to this SO question provide a few alternatives.

Community
  • 1
  • 1
Rich O'Kelly
  • 41,274
  • 9
  • 83
  • 114
  • +1: But how does that particular invocation of `ildasm.exe` help with showing whether the .NET 3.5 or 2.0 framework is being referenced. – Christian.K Feb 22 '12 at 11:20
  • @rich.okelly: do I need to download ildasm or does it come with Visual Studio? – Zaki Feb 22 '12 at 11:28
  • @Sam1 yes, open up the visual studio command prompt and ildasm will be available to you. – Rich O'Kelly Feb 22 '12 at 11:39
  • @rich.okelly: and as for deploying it, do I just need to check config file so it references 3.5 and publish the files? – Zaki Feb 22 '12 at 11:49
  • @Sam1 I assume you're referring to the `runtimeVersion` property - this refers to the version of ASP.Net the app should run under, update it if it has changed too. – Rich O'Kelly Feb 22 '12 at 12:43
1

You can easily check which version the assembly is build against by opening it up in Reflector (or another decompiler).

sovanesyan
  • 1,098
  • 1
  • 8
  • 15
  • thanks for the answer, do you know of any free ones i can use? searched and redgate is not free – Zaki Feb 22 '12 at 11:34
  • 1
    Telerik just released [JustDecompile](http://www.telerik.com/products/decompiler.aspx) and it's free. (it's also good) – sovanesyan Feb 22 '12 at 11:37
1

The CLR for .NET 3.0 and .NET 3.5 is the same CLR from .NET 2.0.

Hence the best way to check, if your assemblies are upgraded or not, is to use Assembly version. Do maintain assembly version and build version in AssemblyInfo.cs while building the assembly.

Having a strong named assembly is the best way to check.

Maheep
  • 5,539
  • 3
  • 28
  • 47