Determine framework version used by an application or a .dll

Hi,

    Is there a way to determine if an application (currently running
in windows) is using the 3.0, 3.5 net framework??

I already tried several methods and lost many hours on this but I
always get the CLR version and not the "real" framework version

How do I get the used framework version (or the target framework) of
an application?

Thanks,
0
SQACSharp
5/2/2010 9:35:27 AM
dotnet.languages.csharp 1931 articles. 0 followers. Follow

12 Replies
2069 Views

Similar Articles

[PageSpeed] 25

On 5/2/2010 5:35 AM, SQACSharp wrote:
> Hi,
>
>      Is there a way to determine if an application (currently running
> in windows) is using the 3.0, 3.5 net framework??
>
> I already tried several methods and lost many hours on this but I
> always get the CLR version and not the "real" framework version
>
> How do I get the used framework version (or the target framework) of
> an application?
>
> Thanks,

3.0 and 3.5 use additional dlls on top of the 2.0 CLR.  If you aren't 
using the new dlls to the later version, it shouldn't matter if they are 
installed.

Now .Net 4.0 will report a different number for Environment.Version. 
But you didn't ask about that version.

-- 
Mike
0
Family
5/2/2010 11:25:36 AM
> 3.0 and 3.5 use additional dlls on top of the 2.0 CLR. =A0If you aren't
> using the new dlls to the later version, it shouldn't matter if they are
> installed.

An application can be 2.0,3.0 and 3.5 without using/referencing any
new dll when targeting a particular framework.  In this case we cant
check the referenced dll to identify the targeted version.
0
SQACSharp
5/2/2010 6:04:26 PM
On 02-05-2010 05:35, SQACSharp wrote:
>      Is there a way to determine if an application (currently running
> in windows) is using the 3.0, 3.5 net framework??
>
> I already tried several methods and lost many hours on this but I
> always get the CLR version and not the "real" framework version
>
> How do I get the used framework version (or the target framework) of
> an application?

Try look at registry variables.

http://stackoverflow.com/questions/199080/how-to-detect-what-net-framework-versions-and-service-packs-are-installed

should get you started.

Arne
0
ISO
5/3/2010 1:51:17 AM
> Try look at registry variables.
> http://stackoverflow.com/questions/199080/how-to-detect-what-net-fram...

Thanks but this is only to check if the framework is installed.

I want to know if application abcd.exe or blabla.dll is using the
framework 2.0 , 3.0 or 3.5.
You can target a specific framework in the application/dll and I need
to know what framework version is targeted by the file at runtime.  I
can get the CLR version by getting application process and by looking
at mscorlib.dll version, but look like there is no way to get "real"
FRAMEWORK version when CLR version is 2

0
SQACSharp
5/3/2010 5:11:47 AM
SQACSharp wrote:
>> Try look at registry variables.
>> http://stackoverflow.com/questions/199080/how-to-detect-what-net-fram...
> 
> Thanks but this is only to check if the framework is installed.
> 
> I want to know if application abcd.exe or blabla.dll is using the
> framework 2.0 , 3.0 or 3.5.
> You can target a specific framework in the application/dll and I need
> to know what framework version is targeted by the file at runtime.  I
> can get the CLR version by getting application process and by looking
> at mscorlib.dll version, but look like there is no way to get "real"
> FRAMEWORK version when CLR version is 2

I may not understand the question entirely.  But, you can load an 
assembly and then call GetReferencedAssemblies() to determine which 
assemblies it references.  The information returned includes version 
information.

For an already-running process, it should be simpler: just look at the 
DLLs that are actually loaded in the process.

One of your replies in this thread seems to indicate that you are 
looking for compile-time information.  Specifically, rather than the 
actual assembly version of DLLs referenced, you want to know the SDK 
version used to compile the program.  As that's a compile-time thing, 
AFAIK there is no way to obtain that information from the compiled 
assembly.  However, there really should be no practical use for that 
information either.

If you can explain what you're actually trying to accomplish, rather 
than your predetermined mechanism for accomplishing it, you might get a 
better answer that is more directly useful in achieving your goal.

Pete
0
Peter
5/3/2010 5:38:09 AM
At runtime,

I'm Looping on all running processes on my machine to get all
*managed* process. (*ANY* process using mscorlib.dll)

Once I get the list of managed applications running on pc

I need to determine the precise net framework version used by theses
applications.

Problem :
I know if the running application use the framework 1.0, 1.1 but the
problem is when the application use net framework 2, 3, 3.5.  Since
they all use the same CLR version there is no way to distinguish them.
(Framework version not clr version)

When creating net application we can specify the target framework (2,
3 , 3.5)

I need to know what is the targeted framework of this application (not
my application)

Seems totally impossible I cant figure this out.

BTW it seems you CANT even create an application from scratch like
"Hello world, I'm running on framework 3.5" without using a
conditional compile constants or config file.... right ??

It's for a kind of spy++ tool
0
SQACSharp
5/3/2010 11:02:31 AM
SQACSharp wrote:
> At runtime,
> 
> I'm Looping on all running processes on my machine to get all
> *managed* process. (*ANY* process using mscorlib.dll)
> 
> Once I get the list of managed applications running on pc
> 
> I need to determine the precise net framework version used by theses
> applications.

As I said, this is likely to be impossible.

> Problem :
> I know if the running application use the framework 1.0, 1.1 but the
> problem is when the application use net framework 2, 3, 3.5.  Since
> they all use the same CLR version there is no way to distinguish them.
> (Framework version not clr version)

Applications _using_ 3.0 and 3.5 features will be using additional DLLs 
that you can look for, as well as examine the versions of.

> When creating net application we can specify the target framework (2,
> 3 , 3.5)

The targeting of a framework is, as I said, a compile-time thing.  It 
may or may not produce observable differences in the compiled output.

> [...]
> It's for a kind of spy++ tool

Spy++ doesn't tell you what version of the compiler was used to create 
the application in question, nor which version of the Windows SDK.  Why 
do you think that your similar tool should tell you that kind of 
information about a managed executable?

Pete
0
Peter
5/3/2010 3:32:51 PM
So I will have to do a kind of partial version recognition based on
referenced dll version ;o).   Thanks Peter

0
SQACSharp
5/3/2010 9:52:23 PM
On 03-05-2010 01:11, SQACSharp wrote:
>> Try look at registry variables.
>> http://stackoverflow.com/questions/199080/how-to-detect-what-net-fram...
>
> Thanks but this is only to check if the framework is installed.
>
> I want to know if application abcd.exe or blabla.dll is using the
> framework 2.0 , 3.0 or 3.5.
> You can target a specific framework in the application/dll and I need
> to know what framework version is targeted by the file at runtime.  I
> can get the CLR version by getting application process and by looking
> at mscorlib.dll version, but look like there is no way to get "real"
> FRAMEWORK version when CLR version is 2

If you know which versions are on the system and you know
what versions a given app require, then what are you missing?

Arne

0
ISO
5/4/2010 1:22:06 AM
On 03-05-2010 07:02, SQACSharp wrote:
> At runtime,
>
> I'm Looping on all running processes on my machine to get all
> *managed* process. (*ANY* process using mscorlib.dll)
>
> Once I get the list of managed applications running on pc
>
> I need to determine the precise net framework version used by theses
> applications.

Processes are not really using "a framework version". They are running
under a specific CLR version and using certain assemblies.

Do you define a framework 3.0 app as an app that:
- runs in 2.0 CLR
- does require one or more assemblies that started shipping with 3.0
- does not require any assemblies that started shipping with 3.5
?

Arne
0
ISO
5/4/2010 1:25:23 AM
>If you know which versions are on the system and you know
>what versions a given app require, then what are you missing?
That's what I need identify the version of an individual application.
(not my application, any possible .net application)

> Do you define a framework 3.0 app as an app that:
> - runs in 2.0 CLR
> - does require one or more assemblies that started shipping with 3.0
> - does not require any assemblies that started shipping with 3.5
Run 2.0 clr,  I can guess the version by looking at reffered
assemblies but nothing prevent a net 3.5 application to not using >2.0
framework stuff so there is no "good" way to identify that version.
0
SQACSharp
5/6/2010 11:35:21 AM
On 06-05-2010 07:35, SQACSharp wrote:
>> If you know which versions are on the system and you know
>> what versions a given app require, then what are you missing?
> That's what I need identify the version of an individual application.
> (not my application, any possible .net application)
>
>> Do you define a framework 3.0 app as an app that:
>> - runs in 2.0 CLR
>> - does require one or more assemblies that started shipping with 3.0
>> - does not require any assemblies that started shipping with 3.5
> Run 2.0 clr,  I can guess the version by looking at reffered
> assemblies but nothing prevent a net 3.5 application to not using>2.0
> framework stuff so there is no "good" way to identify that version.

What makes an app a 3.5 app if if is not using any 3.0 and 3.5
assemblies?

Arne
0
ISO
5/6/2010 11:44:07 PM
Reply:

Similar Artilces:

Using checkbox to edit criteria
I have a table (Table1) that has a field referred to as 'Type'. For some of the records, 'Type' is null and for others there is data in that field. I would like to run a query that returns the records from thTable1 where 'Type' Is Null based on whether a checkbox is checked on a form, however, I am unsure as to how to accomplish this. Here is the query that I have now which is not working: Select * FROM Table1 WHERE Table1.Type IIF(chkType = FALSE, Is Null, Is Not Null); Thank you in advance for your help. Try this -- Select * FROM Table1 ...

Using PowerPoint to create slides for karaoke lyrics
Our music ministry is wanting to use PowerPoint slides of our original music on our overhead computer projection system during church services. We need to be able find individual slides quickly since we do not plan our song list before services. Does anyone have an easy solution for making this possible. Will a catalog work? Should we use Access instead? It's probably time to move on from PowerPoint if you need to find songs quickly. I use a Program called Presentation Manager where the songs are listed in alphabetical order and you can search for a song even when you are ...

Use icon sets relatively in a pivot table
Hi All! I can use icon sets for certain things, but am unable to figure out how to use them with my existing data. I have a pivot table that may list sales from Quarter 4. If you expand that level of the pivot table you would see the monthly, weekly and daily sales that constituted Quarter 4. But I want to show icons to give a visual cue if Q4 was up from Q3. I would need to do this again in the future to see if Q1 is up from the previous years Q4. Sample Data would be: Week Sales (want to see icons in this column, beside numbers) 4 20 3 15 I w...

How do I configure simple categories in the task application
I am using outlook 2003 at work and am thinking of using 2002 at home. I want to simply configure the task view so that I can in one window look at my tasks. Either filtering them so only one category shows, or by showing them all and which category they belong to. Further I want to be able to check off from this list similar to how you might flag messages in email etc. Anyone familiar with how palm desktop works will know what I'm talking about. If this is too much of a mouthfiul to explain then at least a link to a site with helpful outlook howtos would be good. (Note- I hav...

Using text and formatting sum function in formula
I am attempting to show text in a cell concatenated with the sum function and it works fine. The problem is the result has 10 decimal places in the resulting number. I have tried to use the format function with the sum function without success. Here is the formula I am working with: ="Total is: " & Format(SUM(B96:B104),"0.00") What am I doing wrong? Thank you. Try it like this... ="Total is: "&ROUND(SUM(B96:B104),2) -- Biff Microsoft Excel MVP "Billy B" <BillyB@discussions.microsoft.com> wrote in message news:...

Video stays black or is corrupt when using video conference in RTC
Hi, We are using WinCE 6 R2 (x86) which is updated up to August 2009. In this environment we have developed a video codec for use in the RTC environment. The codec is tested with several senarios, which includes: - Testing on a single WinCE device within a costum FilterGraph, which does the encoding and decoding perfectly. - Testing the encoding and RTP sending process with a receiving client on a XP machine, this also works perfectly. - The incoming RTP data is captured, and this data is able to play perfectly with VLC. However, after testing it inside the RTC environmen...

Creating entity record in inactive view using crm 3.0 sdk
hi everybody, I want to add entity record in inactive view by using crm 3.0 sdk.Already i created a record by using sdk but it was added in' active' view records,but my requirement is to add record directly in 'inactive' view records. Can anybody suggest me how to solve this problem ? Pls provide code samples if anybody have. Waiting for replies. Thanks Prabhakar. you will have to create the record (which you have already done), and then set it's state/status as a separate operation. Dave Ireland "prabhakar.penugonda" <prabhakarpenugonda@discussio...

Let me use the Line Color icon on charts
It would speed up a lot of my work if I could use the Line Color icon on Excel charts, the same way I am able to use the Fill Color and Font Color icons. However, when I highlight any chart object, like the Plot Area, Chart Area, or a Series, the Line Color icon is disabled. -- Stuart Bratesman, Jr., MPP Muskie School of Public Service Univ. of Southern Maine Portland, Maine ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If ...

Outlook 2003 using too much CPU on Vista
Outlook 2003 on Vista constantly uses 40%+ of the CPU. What is it doing? Didn't do this on XP. Also, when I close it it doesn't completely shut down. I usually have to kill it after 5 or 10 mins. I have a dual-core cpu running at 1.9 GHz. -- Don Gollahon Do you have any addins installed Are you using any applications that access outlook data? (including syncing with a pda) -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ ...

Document won't print using show/hide parargraph marks. Blocked?
When I click on the Show/Hide button on paragraph section above the document, it shows my entire page to print with the marks. When I click on it again to Hide the symbols, almost the entire page disappears, and it won't print what I want it to show. What did I do wrong? Maybe almost your entire page somehow got formatted as Hidden text? With Show/Hide turned off, select the whole document (Ctrl-A) and press Ctrl-Shift-H (once or twice). If your text reappears, then that was your problem. On Feb 20, 12:39=A0pm, Sadiemitzi <Sadiemi...@discussions.microsoft.com> wro...

When do I use quotation marks in an Excel formula?
What are the guidelines as to when you do and do not use quotation marks in the criteria section of a function. Quotation marks around a text string; no quotation marks around a number. -- David Biddulph "Deb" <Deb@discussions.microsoft.com> wrote in message news:A1B4B846-A4F4-42C3-842A-F3CE7118D4AA@microsoft.com... > What are the guidelines as to when you do and do not use quotation marks > in > the criteria section of a function. It can get confusing in some cases but the GENERAL rule of thumb is: Always quote text Never quote numbers ...

How can I use this expression "=SUM(RC[a0]:RC[a1])" work in Excel
I need to insert this formula "=SUM(RC[s0$]:RC[s1$])" in a cell such that the values a0 and a1 are variables. How can this be done? Please assist and advice. dim s0 as string 'I'd use long's dim s1 as string s0 = "3" s1 = "6" somecell.formular1c1 = "=SUM(RC[" & s0 & "]:RC[" & s1 & "])" funmi_Bash wrote: > > I need to insert this formula "=SUM(RC[s0$]:RC[s1$])" in a cell such that the > values a0 and a1 are variables. > How can this be done? Please assist and advice...

I'm using outlook on both the desktop and laptop computer
Hello: I'm using Outlook on both my desktop and laptop computer. I would like to put the files in a location that they may be accessable on both without having to save them to a disk and update the files. I am using a wireless router and I think I should be able to update my calendar and task and contacts using either computer with a certain amount of sceurity. Please tell me how I can do this. Thank you http://www.slipstick.com/outlook/sync.htm should be a good place to learn how to do this. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discuss...

Facility for using COST CENTER codes while entering transactions
Hi, To minimise the number of account codes and to analyse my expenses for individual departments , I would like to allot CC for all the Depts. / Activities and use them while entering transactions in the system. Is it possible to do in MS GP ? Is anybody using such a feature now ? Raj Yep, either MDA or Analytical Accounting will do this for you. Mike "INTERNAL AUDITOR" <INTERNALAUDITOR@discussions.microsoft.com> wrote in message news:05471113-51D1-450F-9A30-93B82434CBBC@microsoft.com... > Hi, > > To minimise the number of account codes and to analyse my expe...

Error in loading DLL
We have a Microsoft Office 2000 installed & use it via Terminal Services for Windows 2000. All has been working fine until recently when we try to edit a Macro in Excel 2000 it comes up with the following error 'Microsoft Visual Basic - Error in Loading DLL' then when you click on Help it points to Error 48 You can click on OK several times & it may let you into the macro In addition we sometimes get when trying to record a new macro you get 'Unable to record I have repaired & reinstalled Microsoft Office but this has not resolved the problem Any advice would be ap...

Does Outlook use the DAV protocol?
I'm an Outlook Express user who wants to switch to Outlook. I received a notice from Microsoft that includes the following: "... as of June 30, 2008, Microsoft is disabling the DAV protocol and you will no longer be able to access your Hotmail Inbox via Outlook Express." Please tell me if this action by Microsoft will affect Outlook in the same manner, or am I free to make the switch. "BudV" <BudVitoff@(NO)att.(SPAM)net> wrote in message news:%230XUDi%23zIHA.2384@TK2MSFTNGP02.phx.gbl... > I'm an Outlook Express user who wants to switch to Outlook...

Outlook is used by malware ?
Something weird is going on with my Outlook 2007. After I have new email composed and hit “Send/Receive” button the status quickly display a “Sending a message 4/4” message. Why it says that it had sent 4 messages instead of one (I am absolutely sure that it has no other messages in the queue and only one message added to “Send” folder after the whole thing)? I have a suspicion that may be some malware on my PC using outlook to send emails and to conceal its presence it only does that when I and sending mine. I checked my PC for any viruses and spyware and found nothing. Any ideas of...

Creating and using a template
I want to send the same email to a couple of companies with a theme (artsy). I created the email I wanted, saved it as an outlook template but have been been unable to reload it to make minor changes and send to another company. I have been using outlook for some time but not templates. Any help appreciated. Thanks -- David ...

Upgrade Publisher 97 to newer version
HI - I have Publisher 97 cd that came w/ my old computer (long gone). I wnat to get an entire new software upgrade so I can put in on my new Vista Oper system. Do I have to pay for brand new software or can I just pay for an upgrade? If the latter is the answer, how do I go about doing this? Thanks so much. -- E These are the Upgrade qualifying products: Microsoft Publisher 2000-2002; Microsoft Office Publisher 2003; Microsoft Publisher Deluxe 2000-2002; Microsoft Office Publisher 2003 with Digital Imaging; any 2000-2007 Microsoft Office suite; any Microsoft Office XP suite. http://o...

using money on windows nt
I have been trying to install the trial version of money on windows nt. However, the installation is never completed. The message I get is this: money requires either windows 1998 second edition, 2000 service pack3, or xp. Can I run money on windows nt? To use Microsoft� Money Deluxe 2005 you need: a.. Windows� 98 SE or later, Windows 2000 SP3 or later, or Windows XP operating system b.. Multimedia PC with Pentium 166 or higher processor (or compatible); Pentium II 266 (or compatible) required for Windows XP; Pentium II 300 (or compatible) recommended c.. 32 M...

version compatibility between GP 5.5 and 6.0
Can I open a GP 6.0 file on GP 5.5? Thanks! Which file you are talking about? Naseer "mishra" wrote: > Can I open a GP 6.0 file on GP 5.5? > > Thanks! This is NOT recommended. Should you hit any tables that have been changed, you will have unpredictable results. -- Richard L. Whaley Author / Consultant / MVP Documentation for Software Users For help learning and better using Dynamics GP,... check out our books at http://www.AccoladePublications.com "mishra" wrote: > Can I open a GP 6.0 file on GP 5.5? > > Thanks! ...

Using Office Assistant to display MY message
Hello! Someone sent me a spreadsheet and when I click certain cells, the office assistant pops up with information specific to the spreadsheet...much like the text you would see in a comment box, although comments are not used in the spreadsheet. Very bazaar! I didn't know it was possible to have your own text display through the office assistant... How do you do it?????? Thanks!!! Brent Is it the Office Assistant or just a message that pops up? If so, it could be Data>Validation>InputMessage. With one of these cells selected go to Data>Validation and see what's...

Problem with different versions of Access
Hello, I am working on a VBA Access pplication which connects to a SQL Server database. I have a continuous form displayed with data, ad it is linked to a database table, so when I enter a value from my form the data in instantaneously updated in the database. The problem I have is that this form works perfectly when I am developping, and using my developpement environement (with Access allowing me to set breakpoints, go step by step in the code and so on), but it does not work when I use it in the PC of the ending user : in this case, when I enter a value in the form, and click in a...

Using CTRL+End
Hi I want to use CTRL+Home and CTRL+End to move from top left to bottom right having finished build the spreadsheet. I am have a problem with CTRL+End in as much as it moves the curser to a long way off the finish spreadsheet even though the cells appear empty. Can anyone advise how to overcome this problem. -- Kind Regards Mick Reply in worksheet.functions. No need to multipost. Rgds, Andy ...

I'm using outlook 2000 office sp3
I have enable the multi profile. I'm unable to open other user mailbox profile other then my own login mailbox. My exchange is 5.5p s3 i.e. I have login as in userA 1) I selected userA profile and keyin the right user id and password. I'm able to read userA mailbox 2) I selected userB profile and keyin userB user id and password. It give me the error message saying I'm unable to open default email folders. what the problem here any solution ...