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

Nov 6, 2009 at 12:16 PM


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) ?





Nov 6, 2009 at 12:43 PM
Edited Nov 16, 2009 at 8: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.

Nov 6, 2009 at 1: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 2:20 PM
Edited Dec 2, 2009 at 2: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();


Dec 7, 2009 at 8:14 PM

Hi Stefano,

Thank for your code!

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