Question

Wondering if there was a tool that would tell me which version of the compact framework was used to build the exe relic left by our departed/absquatulated former coworker, I found this

I downloaded ILSpy as recommended by tsandhol, but see no TargetFramework entry. This is what it contains there (some strings obfuscated to protect the allegedly innocent):

// C:\HoldingTank\PlatLoca.exe
// HHS, Version=1.4.0.15, Culture=neutral, PublicKeyToken=null

// Entry point: PlatypusLocator.MainApplication.Main
// Architecture: AnyCPU (64-bit preferred)
// Runtime: .NET 1.1

using System;
using System.Reflection;
[assembly: AssemblyVersion("1.4.0.15")]
[assembly: AssemblyCompany("Platypi-R-Us Computerized Systems, Inc.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCopyright("Copyright 2006-2014 Platyi-R-Us Computerized Systems, Inc. All wrongs reserved.")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyDescription("Platypus Finding Software")]
[assembly: AssemblyInformationalVersion("6.4.0")]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
[assembly: AssemblyProduct("Platypus-Locating Data Processing")]
[assembly: AssemblyTitle("PlatLoca")]
[assembly: AssemblyTrademark("")]

So is the pertinent piece of info here "Runtime: .NET 1.1"?

Am I to deduce from this that the TargetFramework was CF version 1.0.*?

UPDATE

I do get TargetFramework on an app built for the latest and greatest (not a CF/CE app):

[assembly: TargetFramework(".NETFramework,Version=v4.5.1", FrameworkDisplayName = ".NET Framework 4.5.1")]

UPDATE 2

Trying another suggestion (Corflags), it gave me this:

enter image description here

...but that just took me to here and searching for "CF 1.0.3316.00" seemed to confuse it.

UPDATE 3

Strangely, dotPeek claims that the .Net Framework for this app is v4.5...?!?

UPDATE 4

I'm getting three different stories re: which DLLs the .exe in question uses.

The only references dotPeek shows are:

mscorlib (all of these are version 1.0.50000.0)
System
System.Data
System.Data.SqlServerCe
System.Drawing
System.Windows.Forms
System.Xml

References shown by ILSpy:

coredll.dll
CoreDll.DLL
CoreDll.dll
HUtilCE
mscorlib
OpenNETCF
OpenNETCF.Windows.Forms
Symbol
Symbol.Barcode
Symbol.StandardForms
System
System.Data
System.Data.Common
System.Data.SqlServerCe
System.Drawing
System.Windows.Forms
System.Windows.Forms.DataGrid
System.Xml

The DLLs that are on the device, in \Program Files\HHS:

HUtilCE
OpenNETCF
OpenNETCF.Drawing
OpenNETCF.Windows.Forms
Symbol
Symbol.Barcode
Symbol.BarcodeForms
Symbol.Printing
Symbol.StandardForms
System.Data.SqlClient
System.Data.SqlServerCe

The only one in all three lists is System.Data.SqlServerCe.

Otherwise, the commonalities are:

Both in ILSpy and on the device: HUtilCE, OpenNETCF, OpenNETCF.Windows.Forms, Symbol, Symbol.Barcode
Both in dotPeek and ILSpy: System, System.Data, System.Drawing, System.Windows.Forms, and System.Xml

UPDATE 5

Using ctacke's suggestion to use .NET Reflector, I see for the .exe in question:

// Assembly Reference mscorlib

Version: 1.0.5000.0 
Name: mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes 

So what I have is a device that has CF 1.0.3316.00, on which this .exe runs (because it targets version 1, I guess, although the version #s don't match precisely), and another device that has both CF versions 2 and 3.5, but on which neither does this .exe run, nor does the one based on the same code that targets version 2.

UPDATE 6

In using .NET Reflector to export some by-it disassembled source code. It comes across a few situations where it cannot automatically resolve a referenced assembly:

enter image description here

For the first couple of instances of this, I was able to locate the files and add them. For "system.windows.forms.datagrid" though, no go - they are not on my system.

So should I "Skip" in this case, or will that prevent me from being able to build the disassembled source (I assume "system.windows.form.datagrid" is needed, or else it would have been "dereferenced" out of the project)?

I went ahead with skipping, because I didn't have access to these two files:

system.windows.forms.datagrid
system.data.common

After skipping those files, I opened the source Reflector created. The project cleaned fine; when I tried to build, it presented me with a dialog to save an sln file (Reflector only generated a csproj file).

The build failed with 35 errors, such as: "Unexpected character $" here:

if (((obj2 = this.fieldList[col - 1]) != null) && ((obj2 = <PrivateImplementationDetails>.$$method0x60002ec-1[obj2]) != null))

I reckon this is because of those missing/skipped DLLs.

System.Data.Common == version 1.0.5000.0
System.Windows.Forms.DataGrid is also version 1.0.5000.0

These two missing files do not exist on the 3090, either! How is it that they are required to build/disassemble, but do not even exist on the device on which the .exe runs?

Was it helpful?

Solution

Use .NET Reflector and look in the References at what version of mscorlib the assembly is using.

This assembly uses 2.0 of the CF (I can tell it's CF and not desktop or Mono by the public key token):

enter image description here

And the same assembly build against 3.5:

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top