Bugs item #1986551, was opened at 2008-06-06 14:49
Message generated for change (Comment added) made by zxed
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1986551&group_id=31650

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Framework support
Group: 0.86
Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: tomthorne (tomthorne)
Assigned to: Gert Driesen (drieseng)
Summary: Fails when target net-3.5 with NET SDK 3.5 installed (No VS)

Initial Comment:
0.86-beta1

If you try and target the net-3.5 framework on a PC with _ONLY_
- Net Framework 3.5
- Windows Server 2008 and Net Framework 3.5 SDK
installed, you get an exception here:

System.NullReferenceException: Object reference not set to an instance of an 
object.

NAnt.Core.dll!NAnt.Core.FrameworkInfo.Version.get() Line 177 + 0x25 bytes       
C#
NAnt.Core.dll!NAnt.Core.Project.UpdateTargetFrameworkProperties() Line 1442 + 
0x22 bytes        C#
NAnt.Core.dll!NAnt.Core.Project.TargetFramework.set(NAnt.Core.FrameworkInfo 
value = {NAnt.Core.FrameworkInfo}) Line 470 + 0x7 bytes     C#
NAnt.Core.dll!NAnt.Core.Tasks.PropertyTask.ExecuteTask() Line 189 + 0x38 bytes  
C#
NAnt.Core.dll!NAnt.Core.Task.Execute() Line 178 + 0xb bytes     C#
NAnt.Core.dll!NAnt.Core.Project.InitializeProjectDocument(System.Xml.XmlDocument
 doc = {Document}) Line 1344 + 0xa bytes        C#
NAnt.Core.dll!NAnt.Core.Project.Execute() Line 853 + 0x16 bytes C#
NAnt.Core.dll!NAnt.Core.Project.Run() Line 947 + 0x8 bytes      C#
NAnt.Core.dll!NAnt.Core.ConsoleDriver.Main(string[] args = {Dimensions:[0]}) 
Line 194 + 0xa bytes       C#

and Nant exits.

This is because the 3.5 SDK registry key has changed.

To fix, amend the Nant config file 3.5 framework configuration project node to 
try 2 locations for sdkInstallRoot:

                        <readregistry
                            property="sdkInstallRoot"
                            key="SOFTWARE\Microsoft\Microsoft 
SDKs\Windows\v6.1\WinSDKNetFxTools\InstallationFolder"
                            hive="LocalMachine"
                            failonerror="false" />
                        <readregistry
                            property="sdkInstallRoot"
                            key="SOFTWARE\Microsoft\Microsoft 
SDKs\Windows\v6.0A\WinSDKNetFxTools\InstallationFolder"
                            hive="LocalMachine"
                            failonerror="false"
                            unless="${property::exists('sdkInstallRoot')}" />


----------------------------------------------------------------------

Comment By: zxed (zxed)
Date: 2009-01-28 22:17

Message:
Just a FYI.
in addition to 3.5....

"Fails when target net-2.0 with NET SDK 3.5 installed (No VS)  
0.86-beta1 "

I am guessing this will fail for all versions since the SDK is in 
SOFTWARE\Microsoft\Microsoft
SDKs\Windows\v6.1\WinSDKNetFxTools\InstallationFolder

----------------------------------------------------------------------

Comment By: zxed (zxed)
Date: 2009-01-28 22:14

Message:
Just a FYI.
in addition to 3.5....

"Fails when target net-2.0 with NET SDK 3.5 installed (No VS)  
0.86-beta1 "

I am guessing this will fail for all versions since the SDK is in 
SOFTWARE\Microsoft\Microsoft
SDKs\Windows\v6.1\WinSDKNetFxTools\InstallationFolder

----------------------------------------------------------------------

Comment By: Steve Wagner (lanwin)
Date: 2009-01-10 19:26

Message:
You have to also add 

 <readregistry
        property="sdkInstallRoot"
        key="SOFTWARE\Wow6432Node\Microsoft\Microsoft
SDKs\Windows\v6.1\WinSDKNetFxTools\InstallationFolder"
        hive="LocalMachine"
        failonerror="false" />
 <readregistry
        property="sdkInstallRoot"
        key="SOFTWARE\Wow6432Node\Microsoft\Microsoft
SDKs\Windows\v6.0A\WinSDKNetFxTools\InstallationFolder"
        hive="LocalMachine"
        failonerror="false" />

Otherwise it will not work in 64 Bit windows.

----------------------------------------------------------------------

Comment By: Gert Driesen (drieseng)
Date: 2009-01-10 19:07

Message:
Fixed in CVS.

----------------------------------------------------------------------

Comment By: skolima (skolima)
Date: 2008-12-18 13:26

Message:
Had the same problem. The changed registry path seems to come from 3.5 SP1.
Using the latest beta (2008-08-18) the error is not a null reference, but
simply "SDK is not installed".

----------------------------------------------------------------------

Comment By: Paul Nasrat (pnasrat)
Date: 2008-07-28 08:30

Message:
Logged In: YES 
user_id=105347
Originator: NO

Also hit this and came up with a similar patch to
Nant.Console\App.config.

Any chance this could be checked in to HEAD.

----------------------------------------------------------------------

Comment By: Gert Driesen (drieseng)
Date: 2008-06-06 15:50

Message:
Logged In: YES 
user_id=707851
Originator: NO

This is gonna become impossible to manage, if MS changes the key with each
release.

I'll look into this later. Can you try using the latest nightly build to
see if you still get the NullReferenceException?

Thx!

Gert

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1986551&group_id=31650

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to