Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAnt does not find .NET SDK 4.8 when compiling for .NET4.0 #175

Open
bovlk opened this issue Oct 16, 2019 · 0 comments
Open

NAnt does not find .NET SDK 4.8 when compiling for .NET4.0 #175

bovlk opened this issue Oct 16, 2019 · 0 comments

Comments

@bovlk
Copy link

bovlk commented Oct 16, 2019

NAnt 0.93 does not find .NET SDK 4.8 which comes with Visual Studio 2019. It gives the following error message in resgen task
The SDK for the 'net-4.0' framework is not available or not configured.

This is due to the structure of registry keys .NET SDK 4.8 being different from the structure expected by the locatesdk task.

I analyzed the code of locatesdk task and (not having time to update the code), I came up with the following hack: Copy registry keys and values from keys created by .NET SDK to keys expected by NAnt. This can be done by copying the lines below to a .reg file and then inserting the reg file to registry. The actual values need to be taken from HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\NETFXSDK\4.8

Similar hack likely applies for .NET SDK 4.6 and .NET SDK 4.7

Windows Registry Editor Version 5.00

; Required to avoid NullReferenceException in NAnt
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows]

; Required to allow NAnt to find NETFX tools for .NET SDK 4.6, 4.7 or 4.8
; Copy the actual values from HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\NETFXSDK
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\WinSDK-NetFx40Tools]
"ProductVersion"="4.8.03928"
"ComponentName"="Microsoft .NET Framework 4.8 SDK"
"InstallationFolder"="C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.8 Tools\\"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\WinSDK-NetFx40Tools-x64]
"ProductVersion"="4.8.03928"
"ComponentName"="Microsoft .NET Framework 4.8 SDK"
"InstallationFolder"="C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.8 Tools\\x64\\"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\WinSDK-NetFx40Tools-x86]
"ProductVersion"="4.8.03928"
"ComponentName"="Microsoft .NET Framework 4.8 SDK"
"InstallationFolder"="C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.8 Tools\\"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant