Monday, October 11, 2010

Strong Name Key–“Access Denied” Error on Windows 7 64-Bit in Visual Studio 2010

I got bit my this again today, so thought I’d re-post:

http://thethoughtfulcoder.com/2010/03/16/Strong-Name-Access-Denied-Error-On-Windows-7-64bit-From-Visual-Studio-And-Snexe

I was trying to create a strong name for an assembly in Visual Studio from the project properties using the dialog:

Create Strong Name Key Dialog

After clicking OK I received the following error message: The operation could not be completed. Access is denied.

Strong Name Access Denied Message Box

I then tried from the command prompt using sn.exe and received the same type of message: Failed to generate a strong name key pair -- Access is denied.

sn-AccessDeniedCommandPromptMessage

I found the following blog post Create Strong Name Key - Access Denied Error, but it applies to Windows XP. I searched around for a RSA\MachineKeys folder and found three different locations but it seems the folder C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys is the magic place.

I gave my user the following permissions on the MachineKeys folder and then I was able to sign my assembly :-D

Modify Permissions

Sunday, October 3, 2010

How to Hide the “Ribbon” in SharePoint 2010


I struggled with this quite a bit before finding a solution that – as near as I can tell – simply hides the ribbon without any real consequences.  Of course, no ribbon means that when in a list or library you can’t do a whole lot.  In my case this requirement was handed down because the particular page we’re doing this in will only contain static content, and the customer wanted to save the screen real estate to make SharePoint look “more like our old version.” 

A frustrating request of course, but nonetheless I imagine many of us in the SharePoint world will come across this request at some point or another. 

After a few other attempts (such as simply deleting the controls in SharePoint Designer, or using different CSS methods and <asp:Panel> controls to set visibility and display properties, I kept getting JavaScript errors on the page, loss of the vertical scroll bar, and other odd behavior.

Here’s the solution I ended up with.  We didn’t want to do this at a site-level, so to do it at a page level we simply modified the appropriate <DIV> tags inline in the ASPX page (using SharePoint Designer):

<div id="s4-ribbonrow" class="s4-pr s4-ribbonrowhidetitle" style="display:none">

<div id="s4-ribboncont">


noribbon