Posted By: mstefan | Aug 27th, 2007 @ 10:42 AM
page 1 of 1
Comments: 6 | Views: 2470
mstefan
mstefan
Windows SDK coders do it without a .NET

Is there a command line option (or some other way) to explicitly specify the runtime version for an assembly other than the default (e.g.: "v2.0.50727")? In other words, specify your own value that's returned by Assembly.ImageRuntimeVersion?

littleguru
littleguru
<3 Seattle
I hope not! If the runtime is version 2.0.x it should always return that. What are you trying to achieve? Could you give us further information?
littleguru
littleguru
<3 Seattle
The Assembly.ImageRuntimeVersion is fetched by querying the current framework and returning the version of that. It's an internal framework call and not set by the compiler in any way!

You probably need another way to distinguish your assemblies...
evildictaitor
evildictaitor
if( !succeed( try() ) ) { while(true) try(); }
///<summary>
///Gets a string representing the version of the common language runtime (CLR)
///saved in the file containing the manifest.
///</summary>
///<returns>
///A string representing the CLR version folder name. This is not a full path.
///</summary>
[ComVisible(false)]
public virtual string ImageRuntimeVersion {
   get {
      [...]
   }
}

This is the version of the CLR implementation, not the version of the framework.


littleguru
littleguru
<3 Seattle
*arg* Sorry...

Well as from the description it seems that you need to compile it with the different versions of the C# compiler (for .NET 1.0, .NET 1.1, .NET 2.0, etc) to get the appropriate version embedded.

By default, ImageRuntimeVersion is set to the version of the CLR used to build the assembly. However, it might have been set to another value at compile time.


Sorry again! My fault.
page 1 of 1
Comments: 6 | Views: 2470
Microsoft Communities