Sunday, February 19, 2012

generate a strong name key file

I am a Newbie to programming and databases and would like to create a simple program for doing full text searching on a SQL database.

I have downloaded and installed Visual Basic 2005 Express, Web Developer 2005 Express, and SQL Server 2005 Express.I have watched several hours of video tutorials and done numerous tutorials. I feel I am making progress and having a lot of fun.My machine is running XP home edition.

I have found the following resource that looks like a good place for me to start with creating a full text search program:

“SQL Server 2005 Books Online

Item Finder Sample

http://msdn2.microsoft.com/en-us/library/ms160844.aspx

However I am stuck at the beginning with trying to “generate a strong name key file.” I don’t know how to “open a command prompt” (I did confess to being a Newbie!!).I searched the database for this forum and found a relevant thread stating that “SQLCMD is the command-line utility for SQL Server and is included with SQL Server 2005 Express Edition.”I found the SQLCMD program on my computer but when I opened it, it does appear to provide the options listed below in the tutorial (i.e., “click start,” “Point to all programs,” etc.).

Initially here is what I need based on the first section of the tutorial:

Building the Sample

If you have not already created a strong name key file, generate the key file using the following instructions.

To generate a strong name key file

Open a Microsoft Visual Studio 2005 command prompt. ClickStart, point toAll Programs, point toMicrosoft .NET Framework SDK 2.0, and then clickSDK Command Prompt.

-- or --

Open a Microsoft .NET Framework command prompt. ClickStart, point toAll Programs, point toMicrosoft .NET Framework SDK 2.0, and then clickSDK Command Prompt.

Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed.

Note:

To determine the folder where samples are located, click theStartbutton, point toAll Programs, point toMicrosoft SQL Server 2005, point toDocumentation and Tutorials, and then clickSamples Directory. If the default installation location was used, the samples are located in <system_drive>:\Program Files\Microsoft SQL Server\90\Samples.

At the command prompt, run the following command to generate the key file:

sn -k SampleKey.snk

Important:

For more information about the strong-name key pair, see "Security Briefs: Strong Names and Security in the .NET Framework" in the .NET Development Center on MSDN.

How do I complete this initial step of generating a strong name key file for the tutorial? I guess I am missing something simple and once I get past this I will be able to complete the tutorial. Any help will be greatly appreciated.

Hi,

If you are looking for the place of VS 2005 Command Prompt in menu you can have a look at the picture I have placed at http://www.kodyaz.com/photos/visual_studio_2005/picture347.aspx

After you have run the command promt, then you will go to samples directory using the old dos commands. (cd.. and cd <directory name>)

And then run the command for "sn"

Eralper

|||

Thanks for the picture - it was worth a thousand words. The only problem is that the VS 2005 Command Prompt program is not there on either of my computers that have VS 2005 Express installed.

Perhaps VS 2005 "Express" does not include this feature?

When I use Windows Explorer to try to find the Samples directory in program files, I can't find it either.

If the default installation location was used, the samples are located in <system_drive>:\Program Files\Microsoft SQL Server\90\Samples.

In researching this problem I noticed that SQL Server 2005 "Express" does not support full text search, so I may not be able to do the full text search exercise even if I get past the "generate a strong name key file" issue.

I am really enjoying trying out the "Express" editions of the Microsoft programs and may just have to live with the limitations for now.

|||

With further research I learned that SQL Server 2005 Express "Advanced" does support full text search. So I uninstalled the regular version and installed the "Advanced" version. I am hopeful that I will be able to do full text searches.

But now I am back where I began with trying to do the tutorial with the first step being "generate a strong name key file" as discussed previously.

How can I get the VS 2005 Command Prompt program installed on my machine? I haven't found a download for it and apparently it is not part of the standard install for Visual Studio 2005 Express.

Or, is there another way to "generate a strong name key file"?

Thanks for any help you can provide.

|||It weird that you don't have this, I have nor seen that. However search your machine for SN.exe and then add the path to that .exe as part of your regular windows path. Now go to the directory where the samples are installed and see if sn /? works. If it does then you should be able to build the samples.|||

Thanks Euan.

In working through the various exercises and tutorials in the VB 2005 Express Documentation I have found several instances where the instructions don't quite match up with the program.

As a Newbie I am not familiar with how to add the sn.exe to the regular windows path. I found the sn.exe file in the Program Files\Microsoft Visual Studio 8\SDK\ v2.0\Bin folder. I just don't know what to do with it.

As an immediate solution to being able to work with the sample "ItemFinder" program, I right-clicked the project in Solution Explorer and clicked "Properties" and "Signing" and unchecked "Sign the assembly" which at least allows me to build and run the application. Since it is a sample that will not be distributed, I am not worried about the security. It would be nice to figure out the "strong name key file" issue for future projects.

|||

http://msdn2.microsoft.com/en-us/ms345276.aspx

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=66195&SiteID=1

HTH

No comments:

Post a Comment