BSF Wizard cannot find sn.exe on 64-bit boxes VS 2008 SP1

Nov 6, 2009 at 1:16 PM

Hi,

I installed BSF on a 64bit box.

When I create a new guidance based project it fails to find sn.exe to generate the .snk file.

That's because the Windows SDK is not where BSF assumes it should be....

Is there any pointer to the actual sn.exe location I can configure manually (any xml config file) ?

 

thanks

 

regards

Nov 6, 2009 at 1:43 PM
Edited Nov 16, 2009 at 9:31 PM
In the class CreateStrongNamedKey in method Execute you should not, as you do, use the following instruction to get the path to the SDK:

string sdkDir = Path.Combine(visualStudioDir, @"..\..\..\Microsoft SDKs\Windows\V6.0A\Bin");

On x64 machines Visual Studio goes under %ProgramFiles(x86)% but the VS SDK goes under %ProgramFiles% so your code is failing.


Stefano
Coordinator
Nov 6, 2009 at 2:29 PM

That is correct, the location of the sn.exe utility is not configurable and that is why it doesn't work on 64 bit environments.

At the moment there are 2 options:

1)  change the code yourself, recompile and use it.

2) copy sn.exe to the location where the BSF expects sn.exe

 

Dec 2, 2009 at 3:20 PM
Edited Dec 2, 2009 at 3:21 PM

Hello jean paul,

to retrieve the path to the sn.exe tool you may use the following couple of lines of code:

RegistryKey rk = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Microsoft SDKs\Windows\v6.0A\WinSDKNetFxTools");
string str = rk.GetValue(@"InstallationFolder").ToString();

Thx
Stefano
 

Coordinator
Dec 7, 2009 at 9:14 PM

Hi Stefano,

Thank for your code!

I'll add it to the current codebase so it will be in the next version.

Jean-Paul