AssemblyVersion
Where other assemblies that reference your assembly will look. If this number changes, other assemblies have to update their references to your assembly! Only update this version, if it breaks backward compatibility. The AssemblyVersion
is required.
I use the format: major.minor. This would result in:
[assembly: AssemblyVersion("1.0")]
If you're following SemVer strictly then this means you only update when the major changes, so 1.0, 2.0, 3.0, etc.
AssemblyFileVersion
Used for deployment. You can increase this number for every deployment. It is used by setup programs. Use it to mark assemblies that have the same AssemblyVersion
, but are generated from different builds.
In Windows, it can be viewed in the file properties.
The AssemblyFileVersion is optional. If not given, the AssemblyVersion is used.
I use the format: major.minor.patch.build, where I follow SemVer for the first three parts and use the buildnumber of the buildserver for the last part (0 for local build).
This would result in:
[assembly: AssemblyFileVersion("1.3.2.254")]
Be aware that System.Version names these parts as major.minor.build.revision
!
AssemblyInformationalVersion
The Product version of the assembly. This is the version you would use when talking to customers or for display on your website. This version can be a string, like '1.0 Release Candidate'.
The AssemblyInformationalVersion
is optional. If not given, the AssemblyFileVersion is used.
I use the format: major.minor[.patch] [revision as string]. This would result in:
[assembly: AssemblyInformationalVersion("1.0 RC1")]
Comparing Java 7 and C# 3
(Some features of Java 7 aren't mentioned here, but the using
statement advantage of all versions of C# over Java 1-6 has been removed.)
Not all of your summary is correct:
- In Java methods are virtual by default but you can make them final. (In C# they're sealed by default, but you can make them virtual.)
- There are plenty of IDEs for Java, both free (e.g. Eclipse, Netbeans) and commercial (e.g. IntelliJ IDEA)
Beyond that (and what's in your summary already):
- Generics are completely different between the two; Java generics are just a compile-time "trick" (but a useful one at that). In C# and .NET generics are maintained at execution time too, and work for value types as well as reference types, keeping the appropriate efficiency (e.g. a
List<byte>
as a byte[]
backing it, rather than an array of boxed bytes.)
- C# doesn't have checked exceptions
- Java doesn't allow the creation of user-defined value types
- Java doesn't have operator and conversion overloading
- Java doesn't have iterator blocks for simple implemetation of iterators
- Java doesn't have anything like LINQ
- Partly due to not having delegates, Java doesn't have anything quite like anonymous methods and lambda expressions. Anonymous inner classes usually fill these roles, but clunkily.
- Java doesn't have expression trees
- C# doesn't have anonymous inner classes
- C# doesn't have Java's inner classes at all, in fact - all nested classes in C# are like Java's static nested classes
- Java doesn't have static classes (which don't have any instance constructors, and can't be used for variables, parameters etc)
- Java doesn't have any equivalent to the C# 3.0 anonymous types
- Java doesn't have implicitly typed local variables
- Java doesn't have extension methods
- Java doesn't have object and collection initializer expressions
- The access modifiers are somewhat different - in Java there's (currently) no direct equivalent of an assembly, so no idea of "internal" visibility; in C# there's no equivalent to the "default" visibility in Java which takes account of namespace (and inheritance)
- The order of initialization in Java and C# is subtly different (C# executes variable initializers before the chained call to the base type's constructor)
- Java doesn't have properties as part of the language; they're a convention of get/set/is methods
- Java doesn't have the equivalent of "unsafe" code
- Interop is easier in C# (and .NET in general) than Java's JNI
- Java and C# have somewhat different ideas of enums. Java's are much more object-oriented.
- Java has no preprocessor directives (#define, #if etc in C#).
- Java has no equivalent of C#'s
ref
and out
for passing parameters by reference
- Java has no equivalent of partial types
- C# interfaces cannot declare fields
- Java has no unsigned integer types
- Java has no language support for a decimal type. (java.math.BigDecimal provides something like System.Decimal - with differences - but there's no language support)
- Java has no equivalent of nullable value types
- Boxing in Java uses predefined (but "normal") reference types with particular operations on them. Boxing in C# and .NET is a more transparent affair, with a reference type being created for boxing by the CLR for any value type.
This is not exhaustive, but it covers everything I can think of off-hand.
Best Answer
Depending on what you are looking for there is a Differences between .NET Compact Framework and .NET Framework article on MSDN.