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
1960 Views

Similar Articles

[PageSpeed] 47

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 Min to Calculate across a table
I am attempting to massage data so I can see what the maximum number of pieces I can produce based off of various components. My query to figure out how many of each component is available per unit is complete and the output is: Part_Number, MaxComponent1, MaxComponent2,MaxComponent3, MaxComponent4 Does anyone have any suggestions as to how I could find the MIN of the components and group by part number? Cheers See the MinOfList() function here: http://allenbrowne.com/func-09.html A better solution would be to create a related table with many records for the combinations that are va...

GetSaveAsFilename
When a user closes a workbook I want my macro to retrieve the username logged in to the machine and use that as the filename. Is this possible? ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ In a general module: Option Explicit Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _ "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long Function fOSUserName() As String ' Returns the network login name Dim lngLen As L...

determine mail flow problem!!!!!!!!
Help! :-( Our mailflow from 2 backend 2003 exchange servers keeps queuing up in the outbound queue (which is set to always run delivery). Messages stay in there from 10 to 120 minutes before being sent to our gateway MTA and then sent off site (to hotmail.com for example). However when I telnet from a backend server to the gateway over port 25 and send a test message it goes right away. I can't for the life of me figure out why. One example when viewed in message tracking history says: 10:16am - smtp: store driver, message submitted from store 10:16am - smtp: message submitted to ...

Internet Explorer (Browser) Crashes when using CRM Menu Bar
Problem: A user clicks on a menu bar item within CRM and Internet Explorer crashes. The user is asked if they wish to send the error report to Microsoft and closes out the current IE window. (Obviously this is very annoying when attempting to click on "Tools" > "Advance Find..."). This behavior appears to happen on the client machines that have been tested. When trying to duplicate this issue, I have found that on the initial start-up of CRM the menu system works fine. However, after navigating around in CRM (e.g. moving from the initial start-up screen to W...

Determine columns used
I have 100+ spreadsheets which i have to edit into a certain format. The spreadsheets currently have 100 columns (from 1-100). From there i have to reduce the number of columns set to 8 columns. E.g: 1 2 3 4 5 6 7 8 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (from column 9 onwards, it goes to the 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 next rows' column 1) 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 How do i do that without altering the order of the value of the cell? Let me make sure we understand the question. You have ...

Use this patch from the MS
--jnxtsndxcx Content-Type: multipart/related; boundary="ylajmskifhge"; type="multipart/alternative" --ylajmskifhge Content-Type: multipart/alternative; boundary="xbypdgtfzu" --xbypdgtfzu Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft Consumer this is the latest version of security update, the "October 2003, Cumulative Patch" update which resolves all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express. Install now to help protect your computer from these vulnerabilities, th...

Using "Enter" key to tab over
Hello, Is there a way in Excel to use the enter key to offset to the next column instead of the next row after data is entered (without using vba)? Thanks! Melissa Try this: From the Excel main menu: <tools><options><edit tab> Check: Move selection after Enter Direction: right Does that help? *********** Regards, Ron XL2002, WinXP "Melissa" wrote: > Hello, > > Is there a way in Excel to use the enter key to offset to the next column > instead of the next row after data is entered (without using vba)? > > Thanks! > > Melis...

A few MVVM and Entity Framework questions
I've been out of the .NET game for a few years now [pre 2005] and starting a little project using the Entity Framework and WPF. My understanding is that the MVVM pattern is the way to go nowadays, but I've got a few questions. This is a purely made up example, so forgive any UI design quirks, and I'm leaving out a bunch of code just as the INotifyPropertyChanged stuff. 1. Let's say I've got a heavy-ish model class called Report. I'd like to create a Report browser type of viewer. I'd like the browser to have a combobox / listbox / treeview / something ...

Excel compatibiliy with newer version
I have Office 2000 and I understand there is a patch you can download where you can open files from newer versions of Excel. I can't seem to find anything like that on the MSOffice downloads. Can anyone point me in the right direction? Thanks and God Bless!! -- Sabrena Vick This? Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint File Formats http://www.microsoft.com/downloads/details.aspx?familyid=941b3470-3ae9-4aee-8f43-c6bb74cd1466&displaylang=en ...

Can i use Microsoft Money without internet access ?
I am thinking of installing money on my old pc, which I dont use to connect to the internet. I can download ofx files from my bank and update my accounts. Is there anyway I can startup money without all this live id business ? I trial installed it on a machine that I do use to connect to the internet and it never lets me get past the "sign in with live id" page. Thanks Anita In microsoft.public.money, anita1766@yahoo.com wrote: >I am thinking of installing money on my old pc, which I dont use to >connect to the internet. >I can download ofx files from my bank and update ...

Using Exchange as a POP Server
Can Exchange 5.5 be used as a POP server so that when our staff is out of the office they can check their company e-mail with a client such as Outlook Express? If so, can someone tell me how this is done? Would they log in with their NT name and password? Any help would be much appreciated. Thanks, Tim Rogers "Tim Rogers" <tim<remove this>@soundcare.com> wrote: >Can Exchange 5.5 be used as a POP server so that when our staff is out of >the office they can check their company e-mail with a client such as Outlook >Express? Yes. >If so, can someone t...

Using HitTesting CListView
Hi, I have a CListCtrl which I have used to emulate a grid. I have several columns and rows but I need to be able to click on any particular row and column and find out which row and column I have selected. I have tried to use the following but doesn't seem to work void CListViewView::OnDblclkList(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here DWORD dwPos = ::GetMessagePos (); CPoint point ((int) LOWORD (dwPos), (int) HIWORD (dwPos)); m_List.ScreenToClient(&point); int nIndex; if ((nIndex = m_List.HitTest(point)) != -1)...

Is there an international version of Money 2004 Deluxe?
I live in New Zealand and I want to know if there is an international version of Money 2004 Deluxe that will work here i.e. can I select the NZ$ currency? Yes, there is an international version of Money. But any version of Money can support any currency as the base currency. The choice to be made between Money versions (US, UK, Int, Fr. etc.) is the language of the software, the tax rules for which it has knowledge and the investment possibilities it has. There's probably some others too - they just don't spring to mind. So, if you're an American living in NZ for a couple o...

release date for GP 9.0, spanish version.
Someone knows what is the date to release GP 9.0, spanish version? Thanks. -- Evelin. Hi Evelin, can I contact you about the Spanish version. We are starting to do some research. Thanks "Ana Evelin Rosa" wrote: > Someone knows what is the date to release GP 9.0, spanish version? > > Thanks. > > -- > Evelin. Sure... this is my email address: anar@segacorp.com Bye. -- Evelin. "Zach Morgan" wrote: > Hi Evelin, can I contact you about the Spanish version. We are starting to > do some research. > > Thanks > > "Ana Ev...

Message sorting after using the find feature.
When Outlook is sorted by received (up) so that the newest messages appear at the bottom of the screen -&- you search using the find toolbar -then view your results -then click the X to close the find toolbar, the view will revert to and highlight the oldest message rather than the newest that was highlighted prior to the find function. This is not the way that Word97 worked and was curious if anyone else had noticed this and/or found a solution. Thanks. ...

converted older version
I have updated a database from an older version of access and am recieving a "This recordset is not updateable" message when I'm trying to chage a record..How can I make all my records capable of being updated? See: Why is my query read-only? at: http://allenbrowne.com/ser-61.html for a list of possible reasons. It might be as simple as a missing index on the ONE side of a join. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "66motors...

Dynamically determining when a month ends
Hello all, Ok, I have a simple excel spreadsheet, where I keep track of my spending on one tab, my income in another and my summary in a thrid. My problem happens when I try to dynamically calc. avg's for months in the summary page. For instance, if I want to see how much money I spent on average per month, or even per day, I draw from the data entered into the spending page. Now, the spending page is set up with the following columns: Date:: Description:: Amount The problem with this is that I can't predefine a max row # for each month, since I might have 80 entries in spending...

microsoft flat scrollbar control version 6.0
Hi, I have dynamically created the microsoft flat scrollbar control on my modal dialog: o_ScrollBar.Create("",WS_VISIBLE|WS_CHILD,CRect(1004,62,1542,80),this, 1004,0,FALSE); o_ScrollBar.SetOrientation(0); // Set vertical It is created and visable but the event OnScroll() belonging to this control is never fired if i move the scrollbox around. I created a second MS flat scrollbar via resource workshop and added the classes and meber to my project. This second control does fire the OnScroll() event. Why does the dynamically created scrollbar not fire the OnScroll() event ???? N...

closing a form that uses a Dlookup
I have a form I use to enter new production requirements in to a table. On that form I have a the following controls Code Qty Needed Date Needed Plan Date The Code control has the following VBA on the On Exit event: Private Sub fldcode_Exit(Cancel As Integer) Dim varrtgno As String Dim vardays As Double Dim varfstop As Date Dim varplandate As Date varrtgno = DLookup("[rtg_no]", "dbo_imitmidx_sql", "[item_no]='" & [Forms]![frm enter fillroom requirements]![fldcode] & "'") 'Me!rtgno = varrtgno Select Case varrtgno ' some cas...

wmpnetwk.exe using 100% of CPU
The process wmpnetwk.exe is continually using all of my CPU. I am using Windows 7 and I want to share media to my D-Link DSM-750. Is there any way to temporarily turn this off and then turn in back on when I need to share files? ...

One use unabel to access Outlook webmail
I have a costumer that are running small biss 2003 with exchange. all are abole to read there mail throw outlook webmail except for one. we have tried changing her password, she is inn all the same groups as the others and she has outlook web enaboled as the other users. Any suggestion? What happens when she attempts to logon? Are there corresponding entries in the event logs? Nue "hans jacobsen" <hansjacobsen@discussions.microsoft.com> wrote in message news:73BF4D97-67B6-4C45-9BE6-6D3DFB2AE7B6@microsoft.com... >I have a costumer that are running small biss 2003 with e...

Animated GIF
Is there a way to insert an Animated GIF to XL? -- Regards, Marvin Hlavac Toronto, Canada Hi I have not found a way to put an animated gif directly into an excel worksheet, at least up to excel 97. As for newer versions, I don't know if any of them support animated gifs. Animated gifs can be used in an excel vba user form using the free gif89 control. HTH Ken "Marvin Hlavac" <hlavac@rogersSPAM.com> wrote in message news:%23Uuz87MlDHA.424@TK2MSFTNGP10.phx.gbl... > Is there a way to insert an Animated GIF to XL? > > -- > Regards, > Ma...

how to determine the size of the sheet
Hi I had a collegue who told me once a way to dtermine the number of the rows in a sheet of the workbook I am working at. It is known that when you open a new workbook each sheet has maybe 65365 or something like that rows. MY QUESTION IS: HOW TO MAKE THE SHEET 1000 ROWS OR WHATEVER NUMBERS OF ROWS I ONLY NEED? Thanks in Advance, Ahmed Hi Ahmed The number of rows and columns are fixed. Your workaround would be to hide the ones you consider unneeded. HTH. Best wishes Harald "Ahmed SHEBL" <ahmad.shebl@hotmail.com> skrev i melding news:%231uFO3IcHHA.4720@TK2MSFTNGP0...

how do I set up outlook for home use?
How do I set up my microsoft outlook e-mail for home use? Contact your ISP for your mail account settings (or import them from Outlook Express if you have it setup there.) Install your profile and account settings and you are good to go. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. After furious head scratching, dauexghouse asked: | How do I set up my microsoft outlook e-mail for home use? ...

Organizing workbooks using file folders
Hi I need some some help with organizing workbooks. If anyone can give me an idea about how to organize workbooks through file folders, I would appreciate it Hi ~X Could you be a bit more specific please? What is that you need to do -- Message posted from http://www.ExcelForum.com ...