Different framework for different tasks...

83 views
Skip to first unread message

Matt Jones

unread,
Oct 14, 2011, 3:41:42 PM10/14/11
to psake-users
For our build, we have to build both 64 bit and 32 bit. I had hoped
that I could define the framework within the task, but can't seem to
figure out how to do that.

Here's my test script:

task default -depends ShowMsBuildVersion4, ShowMsBuildVersion35

task ShowMsBuildVersion4 {
Framework "4.0"
msbuild /version
}

task ShowMsBuildVersion35 {
Framework "3.5"
msbuild /version
}

And as you can see in it's output, it picks up .NET 3.5 for both. Any
ideas on how to approach building for multiple frameworks?

PS C:\svn\common\trunk\deploy> Invoke-psake .\versionTest.ps1
psake version 4.00
Copyright (c) 2010 James Kovacs

Executing ShowMsBuildVersion4
Microsoft (R) Build Engine Version 3.5.30729.5420
[Microsoft .NET Framework, Version 2.0.50727.5448]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

3.5.30729.5420Executing ShowMsBuildVersion35
Microsoft (R) Build Engine Version 3.5.30729.5420
[Microsoft .NET Framework, Version 2.0.50727.5448]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

3.5.30729.5420
Build Succeeded!

----------------------------------------------------------------------
Build Time Report
----------------------------------------------------------------------
Name Duration
---- --------
ShowMsBuildVersion4 00:00:00.0642430
ShowMsBuildVersion35 00:00:00.0596593
Total: 00:00:00.1399476

James Kovacs

unread,
Oct 15, 2011, 8:22:03 PM10/15/11
to psake...@googlegroups.com
The .NET Framework version cannot be changed on a per-task basis. Load paths are set up early during build script initialization and not reparsed once the tasks are actually running. This is just the current implementation and I haven't looked at how easy or hard it would be to change once tasks are running. As always, patches are welcome...

BTW - You could also look at shelling out to child psake scripts - one for each desired framework version - and set the framework at the top of each child script.

James
--
James Kovacs, B.Sc., M.Sc.
http://jameskovacs.com
jko...@post.harvard.edu
@jameskovacs (Twitter)
403-397-3177 (mobile)
jameskovacs (Skype)



--
You received this message because you are subscribed to the Google Groups "psake-users" group.
To post to this group, send email to psake...@googlegroups.com.
To unsubscribe from this group, send email to psake-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/psake-users?hl=en.


Matt Jones

unread,
Oct 17, 2011, 8:38:48 AM10/17/11
to psake-users
Thanks for the reply. I'll look into using child scripts to do the
work.

Thanks again!

On Oct 15, 7:22 pm, James Kovacs <jkov...@post.harvard.edu> wrote:
> The .NET Framework version cannot be changed on a per-task basis. Load paths
> are set up early during build script initialization and not reparsed once
> the tasks are actually running. This is just the current implementation and
> I haven't looked at how easy or hard it would be to change once tasks are
> running. As always, patches are welcome...
>
> BTW - You could also look at shelling out to child psake scripts - one for
> each desired framework version - and set the framework at the top of each
> child script.
>
> James
> --
> James Kovacs, B.Sc., M.Sc.http://jameskovacs.com
> jkov...@post.harvard.edu
Reply all
Reply to author
Forward
0 new messages