FrameworkSdkDir WindowsSDKDir after switch to VS 2010 in msbuild

Hello,

We switched to VS2010. And now have a problem that the FrameworkSDKDir and WindowsSDKDir msbuild variables are incorrect. Probably not an FinalBuilder issue, but maybe you know a fix, or a workaround within finalbuilder.

Our situation Before: VS2005 solution, with several VB projects that have afterbuild steps in it.
As a sample, this is what is in our afterbuild step within the VB project :   call  "$(FrameworkSDKDir)bin\sgen.exe" /force /assembly:"$(TargetPath)"
We build the solution as a whole, and have checked the checkbox in Finalbuilder to use MSBuild.

Our current situation: Solutions was converted to VS2010. The FinalBuilder action to build the solution now has the combo set to VS2010, and the checkbox to use MsBuild is still checked.
When running the action we get an error MSB3073 - system cannot find path, but in dutch :-)
The path in the erromessage only shows bin\sgen.exe and the rest of the commandline, so FrameworkSDKDir seems not to be available.

The Windows SDK V7.1 was already installed on the server. And also the .Net Framework SDK 2.0 was installed (and probably used in the afterbuild)
I tried setting the active SDK version  by using the SDK tool:  WindowsSdkVer.exe -version:v7.1 . That does not help.
Using the WindowsSDKDir instead of FrameworkSDKDir does not help
Adding the two dir items in the system configuration does not help.
Adding an extra backslash does not help.
When I hardcode the correct folder, I have no problem.

So:  Does anyone know a direction of how to fix this, or how to workaround this problem?
By the way, using FB 6.3.0.2172

Thanks,
Jaap

Hi Jaap

The SDK and framework location detection is controlled by a file in the FinalBuilder install folder called DotNetConfig.xml

The entry is currently set to :

[code]<SDKInstallPath><Key>SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx40Tools</Key><Value>InstallationFolder</Value></SDKInstallPath>[/code]

you can change this to the correct value. The v7.0A SDK is installed with VS2010, the 7.1 release is the standalone release made available after VS201 shipped. I’lll see if we can update the config file for the 7.1 sdk.

Hello Vincent,

After all those years you are still as quick as ever.

In my VBProj file I now use  WindowsSDKDir.
And I changed the FB DotNetConfig. One thing to know is that not all versions use the same registry key. So I now have this in my DotNetConfig (as key under the 4.0 Framework item), and that works:  SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1\WinSDKNetFx35Tools   (and not WinSDK-NetFx35Tools)

One small problem left for me: Not for all the developers this works. We will fix that by ourself. But maybe you have a simple solution:
When I use FrameworkSDKDir all developers (with VS 2010 installed) are happy. But I do not want to install VS on the build machine. So There I have the Win SDK installed. And so the build is happy with WindowsSDKDir.
Is there a way in the DotNetConfig to be able to use the FrameworkSDKDir on the build server?
If not, we will fix this on the developers machines.

Thanks,
Jaap.

Hi Jaap

Please try the attached xml file, this should work for the 7.0A or 7.1 sdk's

 

001_DotNetConfig.xml (3.164 KB)

Typical of Microsoft to change something like this… they never seem to pay any attention to detail.

Vincent,

The config you have contains kind of the thing I created myself. But my problem still exists: The VisulaStudio/msbuild macro WindowsSDKDir is available inside the VBProj afterbuild, but the FrameworkSDKDir macro still is empty.

Is there a way to influence the value of that macro in FinalBuilder, or must I look for other ways to fix this?
Or maybe you know of a nice way to maken the WindowsSDKDir macro available on all our developer PCs?

Thanks,
Jaap

Hi,

Just to let you know: I fixed this now by just using something like 

if exist $(WindowsSDKDir)\bin\rc.exe (
   call $(WindowsSDKDir)\bin\rc.exe ......
) else (
   call $(FrameworkSDKDir)\bin\rc.exe
)

I do not like it very much, because it is repeated in a lot of projects. And the build for developers is not exactly the same as for the builder anymore. And just that was the reason to do all pre/after build steps inside the vbproj files, and not inside the FB script/actions.

So if FB can influence the FrameworkSDKDir, we change back to that one. For now, we use the if statements like above.

Regards,
Jaap.

 

Hi Jaap

This really seems to be an SDK install issue and not a new one :

http://blogs.msdn.com/b/windowssdk/archive/2008/06/30/winsdk-bug-notification-sdk-config-tool-appears-to-work-but-fails.aspx

The DotNetconfig.xml file we use is only used to allow us to find the tools(because the registry entries are often wrong) … we do not influence the FrameworkSDKDir or the WindowsSDKDir at all, that is controlled by the SDK install.

Vincent,

Maybe a little off (FB) topic, but to make the discussion a bit more complete for when others hit the same problem:

I already had the feeling yyou did not influence these msbuild/VisualStudio 'macros'. But I read something on an MS forum about calling msbuild to change environment, so was not sure anymore.

The MS forum topic you linked to is specific for VS 2008. For VS 2010 Microsoft somewhere made a not well documented switch. There are documents about VS2010 always referencing its own SDK. And there are some documents about choosing some platform toolkit inside the IDE. But I never have found this setting in tools, solutions settings or project settings.

I understand why microsoft struggles with this, because this is something that depends of the SDK you have installed on your (build) machine, but also belongs to the project settings, where you declare what .Net framework you target. Maybe we would be best off when both settings would be a solution wide setting.

Regards,
Jaap.