[Mono-dev] Microsoft.Build: The parameter 'FrameworkVersion45Path' was not found for the 'GetFrameworkPath' task

Robin Neatherway robin.neatherway at gmail.com
Fri Feb 1 11:17:51 UTC 2013


Update: a compiled example works properly. It seems that my version of FSI
is compiled against .NET 4.0 and so loads the corresponding assemblies.


On Thu, Jan 31, 2013 at 4:55 PM, Robin Neatherway <
robin.neatherway at gmail.com> wrote:

> Although, as I am running from the F# Interactive, perhaps 4.0 is the
> correct place to load these DLLs from? There doesn't seem to be a way to
> specify which DLL should be preferred in this case. I will try compiling a
> small example with TargetFramework 4.5 and see if that works.
>
>
> On Thu, Jan 31, 2013 at 4:48 PM, Robin Neatherway <
> robin.neatherway at gmail.com> wrote:
>
>> Hi,
>>
>> The small script I gave at the top is sufficient to observe the
>> behaviour. If you put it in a file, say "Script.fsx" and run it with
>> `fsharpi Script.fsx`, you will be able to reproduce the behaviour. Likewise
>> for the GetFrameworkPath fragment (once the DLLs have been loaded with #r).
>> Would a compilable version be more helpful?
>>
>> I had another look in my lib/mono/4.5 directory and found that the
>> Microsoft.Build.* DLLs there are symlinks to the gac 4.0 versions:
>>
>>   lib/mono/4.5 $ ls -l Microsoft.Build.*
>> lrwxrwxrwx 1   68 Jan 30 18:50 Microsoft.Build.dll ->
>> ../gac/Microsoft.Build/4.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.dll*
>> lrwxrwxrwx 1   82 Jan 30 18:50 Microsoft.Build.Engine.dll ->
>> ../gac/Microsoft.Build.Engine/4.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.Engine.dll*
>> lrwxrwxrwx 1   88 Jan 30 18:50 Microsoft.Build.Framework.dll ->
>> ../gac/Microsoft.Build.Framework/4.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.Framework.dll*
>> lrwxrwxrwx 1   90 Jan 30 19:26 Microsoft.Build.Tasks.v4.0.dll ->
>> ../gac/Microsoft.Build.Tasks.v4.0/4.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.Tasks.v4.0.dll*
>> lrwxrwxrwx 1   98 Jan 30 18:50 Microsoft.Build.Utilities.v4.0.dll ->
>> ../gac/Microsoft.Build.Utilities.v4.0/4.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.Utilities.v4.0.dll*
>>
>> However the DLLs in lib/mono/4.0 are not symlinks, they are normal files.
>> The ones in the GAC are the same as those that are in class/lib/net_4_5/
>> after building, while the other files in lib/mono/4.0 are the same as those
>> in class/lib/net_4_0
>>
>> Perhaps this is the source of the problem.
>>
>> Robin
>>
>>
>> On Thu, Jan 31, 2013 at 3:29 PM, Marek Safar <marek.safar at gmail.com>wrote:
>>
>>> Hi,
>>>
>>> This is most likely Mono bug in how we load Task libraries. It'll load
>>> the version from folder where Microsoft.Common.targets is which is
>>> incorrect in your case because it's 4.0 version and not 4.5. Some kind of
>>> self contained sample how F# is using Microsoft.Build* would be useful.
>>>
>>> Marek
>>>
>>>  I'm trying to execute the ResolveAssemblyReferences task using the
>>>> Microsoft.Build namespace. This (F#) project builds nicely from the command
>>>> line using xbuild, so the logic is capable. The project file can be found
>>>> here:
>>>> https://github.com/fsharp/fsharpbinding/blob/master/FSharp.AutoComplete/FSharp.AutoComplete.fsproj and
>>>> has TargetFrameworkVersion set to 4.5. If I change TargetFrameworkVersion
>>>> to 4.0, it works.
>>>>
>>>> I downloaded mono from github and am running the latest version: Mono
>>>> JIT compiler version 3.0.4 (master/e5fba9d Wed Jan 30 18:38:48 GMT 2013). I
>>>> also tried with 3.0.3, with the same effect.
>>>>
>>>> The following fsi script is what I am using:
>>>>
>>>> #r "Microsoft.Build.Engine"
>>>> #r "Microsoft.Build.Framework"
>>>> #r "Microsoft.Build.Tasks.v4.0"
>>>> open Microsoft.Build.BuildEngine
>>>> open Microsoft.Build.Framework
>>>> open Microsoft.Build.Tasks
>>>>
>>>> let p = new Project()
>>>> let cl = new ConsoleLogger(LoggerVerbosity.Diagnostic)
>>>> p.ParentEngine.RegisterLogger(cl)
>>>> p.Load("FSharp.AutoComplete.fsproj")
>>>>
>>>> p.Build([|"ResolveAssemblyReferences"|])
>>>>
>>>> which results in:
>>>>
>>>> <path>/FSharp.AutoComplete.fsproj (ResolveAssemblyReferences) ->
>>>> /home/scratch/local_mono/lib/mono/4.0/Microsoft.Common.targets
>>>> (GetFrameworkPaths target) ->
>>>>
>>>> /home/scratch/local_mono/lib/mono/4.0/Microsoft.Common.targets: error :
>>>> Error executing task GetFrameworkPath: The parameter
>>>> 'FrameworkVersion45Path' was not found for the 'GetFrameworkPath' task.
>>>>
>>>> I found that the framework path for 4.5 doesn't seem to be defined:
>>>>
>>>> let gfp = GetFrameworkPath()
>>>> gfp.FrameworkVersion45Path
>>>>
>>>> error FS0039: The field, constructor or member 'FrameworkVersion45Path'
>>>> is not defined
>>>>
>>>> Although in
>>>> mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GetFrameworkPath.cs
>>>> has a #if NET_4_5 around FrameworkVersion45Path, and .NET 4.5 is definitely
>>>> enabled in the configure script, and I have a fully populated lib/mono/4.5
>>>> directory.
>>>>
>>>> I also found that the Engine toolsets do not include 4.5. I tried
>>>> adding it manually, but this didn't help.
>>>>
>>>> I think this is a bug, and would appreciate any hints in tracking it
>>>> down.
>>>>
>>>> Thanks,
>>>> Robin Neatherway
>>>>
>>>>
>>>> _______________________________________________
>>>> Mono-devel-list mailing list
>>>> Mono-devel-list at lists.ximian.com
>>>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20130201/da2cf13d/attachment.html>


More information about the Mono-devel-list mailing list