How to target .Net other than 4.0 ?
7 posts
• Page 1 of 1
How to target .Net other than 4.0 ?
In a )CLEAR WS if I do:
and if I look at the version loaded of PresentationFramework.dll by doing:
The loaded version of PresentationFramework.dll is version 4.0, I would like to use instead PresentationFramework.dll version 4.5.1 or better, how do I target a specific version of .Net to be used by the APL interpreter ?
The value of dyalog.exe.config that I am using looks like that:
Thanks in advance
⎕USING←'System.Windows.Controls,WPF/PresentationFramework.dll'
ListBox
(System.Windows.Controls.ListBox)
and if I look at the version loaded of PresentationFramework.dll by doing:
]assemblies
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
bridge141_unicode, Version=14.1.26323.0, Culture=neutral, PublicKeyToken=eb5ebc232de94dcf
msvcm80, Version=8.0.50727.6229, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
dyalognet, Version=14.1.26323.0, Culture=neutral, PublicKeyToken=eb5ebc232de94dcf
PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
The loaded version of PresentationFramework.dll is version 4.0, I would like to use instead PresentationFramework.dll version 4.5.1 or better, how do I target a specific version of .Net to be used by the APL interpreter ?
The value of dyalog.exe.config that I am using looks like that:
- Code: Select all
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="MJHSoftware;Syncfusion/4.5;Syncfusion"/>
</assemblyBinding>
<!-- <NetFx40_LegacySecurityPolicy enabled="true"/> -->
<loadFromRemoteSources enabled="true"/>
</runtime>
</configuration>
Thanks in advance
-
PGilbert - Posts: 440
- Joined: Sun Dec 13, 2009 8:46 pm
- Location: Montréal, Québec, Canada
Re: How to target .Net other than 4.0 ?
By using Telerik JustDecompile I was able to confirm that the PublicKeyToken given by ]assemblies is the one of .net 4.6 as requested by the dyalog.exe.config file. I was not able to find the PublicKeyToken of PresentationFramework using VisualStudio however.
-
PGilbert - Posts: 440
- Joined: Sun Dec 13, 2009 8:46 pm
- Location: Montréal, Québec, Canada
Re: How to target .Net other than 4.0 ?
PGilbert wrote:By using Telerik JustDecompile I was able to confirm that the PublicKeyToken given by ]assemblies is the one of .net 4.6 as requested by the dyalog.exe.config file. I was not able to find the PublicKeyToken of PresentationFramework using VisualStudio however.
Hello Pierre,
I think you've answered the question yourself there. It looks like all versions of the file report 4.0 as the .NET version - althought the file version my be different. Here's what I did:
⎕USING←'System.Windows.Controls,WPF/PresentationFramework.dll'
l←⎕new ListBox
l.GetType.Assembly
PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
l.GetType.Assembly.CodeBase
file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.dll
⎕using,←⊂'System.Diagnostics,system.dll'
(FileVersionInfo.GetVersionInfo⊂8↓l.GetType.Assembly.CodeBase).FileVersion
4.6.1073.0
So it looks like the 4.6 version is being loaded anyway. I guess the framework is always redirecting to the latest version.
Best Regards
John Daintree.
-
JohnD|Dyalog - Posts: 74
- Joined: Wed Oct 01, 2008 9:35 am
Re: How to target .Net other than 4.0 ?
Hello John, thanks for answering because I was not sure of my answer since this public token does not seems to be unique among dlls.
I have tried your reasoning with a ListBox created from XAML and got the same result:
This is a pretty neat way to find out the .Net version used by the interpreter.
Thanks for that.
P.S.: May be if the ]assemblies script could be modified to show the .FileVersion à la JD it would be appreciated and useful (-fileVersion switch maybe ?).
I have tried your reasoning with a ListBox created from XAML and got the same result:
lb
<ListBox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</ListBox>
⎕USING←'System.Windows.Markup,WPF/PresentationFramework.dll'
lb_obj←XamlReader.Parse(⊂lb)
⎕USING,←⊂'System.Diagnostics,system.dll'
(FileVersionInfo.GetVersionInfo⊂8↓lb_obj.GetType.Assembly.CodeBase).FileVersion
4.6.1073.0
This is a pretty neat way to find out the .Net version used by the interpreter.
Thanks for that.
P.S.: May be if the ]assemblies script could be modified to show the .FileVersion à la JD it would be appreciated and useful (-fileVersion switch maybe ?).
-
PGilbert - Posts: 440
- Joined: Sun Dec 13, 2009 8:46 pm
- Location: Montréal, Québec, Canada
Re: How to target .Net other than 4.0 ?
Following the comments of John on previous post here is a function that will give the name, version and location of the loaded assemblies. Very useful to know what is loaded with their 'real' version and where it came from.
- Code: Select all
r←GetAssemblies;assemblies;assembly;inter;⎕USING
⍝ Show the Current .Net assemblies that are loaded.
⍝ Returns a 3 column matrix representing the name, version and location of the assembly loaded.
⍝
⍝ Inspired from: http://www.dyalog.com/forum/viewtopic.php?f=35&t=990
r←0 3⍴⍬
⎕USING←'System' 'System.Diagnostics,system.dll'
:Trap 0
assemblies←AppDomain.CurrentDomain.GetAssemblies
:For assembly :In assemblies
:If assembly.IsDynamic
inter←2↑(~inter=',')⊂inter←assembly.ToString
r⍪←inter,⊂'Dynamic assembly with no location'
:Else
inter←1↑(~inter=',')⊂inter←assembly.ToString
inter,←⊂(FileVersionInfo.GetVersionInfo(⊂assembly.Location)).FileVersion
r⍪←inter,⊂assembly.Location
:EndIf
:EndFor
:Else
⍝ If ⎕USING←0⍴⊂'', it will bug.
r←0 3⍴⍬
:End
-
PGilbert - Posts: 440
- Joined: Sun Dec 13, 2009 8:46 pm
- Location: Montréal, Québec, Canada
Re: How to target .Net other than 4.0 ?
Nice. I think that Assembly.IsDynamic is in .NET 4.0 onwards only. Having said that, I think pretty much everyone is running on at least 4 anyway.
-
JohnD|Dyalog - Posts: 74
- Joined: Wed Oct 01, 2008 9:35 am
Re: How to target .Net other than 4.0 ?
I will backup JDs claim on .NET 4. Over the last two years we moved a very upgrade conservative user base to Dyalog 14.0 and .NET 4.0 full profile with only a handful of users needing any extra downloads.
(It's the little things that make the difference :-)
-
norbertjurkiewicz84 - Posts: 62
- Joined: Mon Nov 01, 2010 7:26 pm
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group