<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>ProgramGood.Net - Moq</title>
    <link>http://www.programgood.net/</link>
    <description>The journey to becoming a great programmer</description>
    <language>en-us</language>
    <copyright>Dave Mateer</copyright>
    <lastBuildDate>Mon, 05 Jul 2010 20:54:24 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.2.8279.16125</generator>
    <managingEditor>davemateer@gmail.com</managingEditor>
    <webMaster>davemateer@gmail.com</webMaster>
    <item>
      <trackback:ping>http://www.programgood.net/Trackback.aspx?guid=08d3e832-71fb-4d71-b312-1e80f03597a1</trackback:ping>
      <pingback:server>http://www.programgood.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.programgood.net/PermaLink,guid,08d3e832-71fb-4d71-b312-1e80f03597a1.aspx</pingback:target>
      <dc:creator>Dave Mateer</dc:creator>
      <wfw:comment>http://www.programgood.net/CommentView,guid,08d3e832-71fb-4d71-b312-1e80f03597a1.aspx</wfw:comment>
      <wfw:commentRss>http://www.programgood.net/SyndicationService.asmx/GetEntryCommentsRss?guid=08d3e832-71fb-4d71-b312-1e80f03597a1</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
While using Moq to test an MVC app, and Scott Hanselman’s NerdDinner app, I kept getting
these strange errors.
</p>
        <p>
Problem was permissions on:
</p>
        <p>
C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys
</p>
        <p>
In Windows XP Pro, you need to disable simple file sharing.. from <a title="http://www.windowsbbs.com/windows-xp/52502-cannot-change-permissions-folder.html" href="http://www.windowsbbs.com/windows-xp/52502-cannot-change-permissions-folder.html">http://www.windowsbbs.com/windows-xp/52502-cannot-change-permissions-folder.html</a></p>
        <p>
          <a href="http://www.programgood.net/content/binary/WindowsLiveWriter/Arg.UnabletoobtainpublickeyforStrongName_76E2/image_2.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.programgood.net/content/binary/WindowsLiveWriter/Arg.UnabletoobtainpublickeyforStrongName_76E2/image_thumb.png" width="579" height="528" />
          </a>
        </p>
        <p>
Then I set perms to be full control to everyone:
</p>
        <p>
          <a href="http://www.programgood.net/content/binary/WindowsLiveWriter/Arg.UnabletoobtainpublickeyforStrongName_76E2/image_4.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.programgood.net/content/binary/WindowsLiveWriter/Arg.UnabletoobtainpublickeyforStrongName_76E2/image_thumb_1.png" width="493" height="649" />
          </a>
        </p>
        <p>
More granular perms are in here: <a title="http://groups.google.co.uk/group/RhinoMocks/browse_thread/thread/26df68ff01567509/5ddebf407228edc4" href="http://groups.google.co.uk/group/RhinoMocks/browse_thread/thread/26df68ff01567509/5ddebf407228edc4">http://groups.google.co.uk/group/RhinoMocks/browse_thread/thread/26df68ff01567509/5ddebf407228edc4</a></p>
        <p>
Now this code works:
</p>
        <p>
          <a href="http://www.programgood.net/content/binary/WindowsLiveWriter/Arg.UnabletoobtainpublickeyforStrongName_76E2/image_6.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.programgood.net/content/binary/WindowsLiveWriter/Arg.UnabletoobtainpublickeyforStrongName_76E2/image_thumb_2.png" width="710" height="384" />
          </a>
        </p>
        <p>
On Win7: C:\Users\All Users\Microsoft\Crypto\RSA\MachineKeys
</p>
        <p>
Takes some messing around with granting ownership of the directory, then setting full
control to everyone.
</p>
        <img width="0" height="0" src="http://www.programgood.net/aggbug.ashx?id=08d3e832-71fb-4d71-b312-1e80f03597a1" />
      </body>
      <title>ArgumentException was unhandled by user code. Unable to obtain public key for StrongNameKeyPair</title>
      <guid isPermaLink="false">http://www.programgood.net/PermaLink,guid,08d3e832-71fb-4d71-b312-1e80f03597a1.aspx</guid>
      <link>http://www.programgood.net/2010/07/05/ArgumentExceptionWasUnhandledByUserCodeUnableToObtainPublicKeyForStrongNameKeyPair.aspx</link>
      <pubDate>Mon, 05 Jul 2010 20:54:24 GMT</pubDate>
      <description>&lt;p&gt;
While using Moq to test an MVC app, and Scott Hanselman’s NerdDinner app, I kept getting
these strange errors.
&lt;/p&gt;
&lt;p&gt;
Problem was permissions on:
&lt;/p&gt;
&lt;p&gt;
C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys
&lt;/p&gt;
&lt;p&gt;
In Windows XP Pro, you need to disable simple file sharing.. from &lt;a title="http://www.windowsbbs.com/windows-xp/52502-cannot-change-permissions-folder.html" href="http://www.windowsbbs.com/windows-xp/52502-cannot-change-permissions-folder.html"&gt;http://www.windowsbbs.com/windows-xp/52502-cannot-change-permissions-folder.html&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.programgood.net/content/binary/WindowsLiveWriter/Arg.UnabletoobtainpublickeyforStrongName_76E2/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.programgood.net/content/binary/WindowsLiveWriter/Arg.UnabletoobtainpublickeyforStrongName_76E2/image_thumb.png" width="579" height="528" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Then I set perms to be full control to everyone:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.programgood.net/content/binary/WindowsLiveWriter/Arg.UnabletoobtainpublickeyforStrongName_76E2/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.programgood.net/content/binary/WindowsLiveWriter/Arg.UnabletoobtainpublickeyforStrongName_76E2/image_thumb_1.png" width="493" height="649" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
More granular perms are in here: &lt;a title="http://groups.google.co.uk/group/RhinoMocks/browse_thread/thread/26df68ff01567509/5ddebf407228edc4" href="http://groups.google.co.uk/group/RhinoMocks/browse_thread/thread/26df68ff01567509/5ddebf407228edc4"&gt;http://groups.google.co.uk/group/RhinoMocks/browse_thread/thread/26df68ff01567509/5ddebf407228edc4&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Now this code works:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.programgood.net/content/binary/WindowsLiveWriter/Arg.UnabletoobtainpublickeyforStrongName_76E2/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.programgood.net/content/binary/WindowsLiveWriter/Arg.UnabletoobtainpublickeyforStrongName_76E2/image_thumb_2.png" width="710" height="384" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
On Win7: C:\Users\All Users\Microsoft\Crypto\RSA\MachineKeys
&lt;/p&gt;
&lt;p&gt;
Takes some messing around with granting ownership of the directory, then setting full
control to everyone.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.programgood.net/aggbug.ashx?id=08d3e832-71fb-4d71-b312-1e80f03597a1" /&gt;</description>
      <comments>http://www.programgood.net/CommentView,guid,08d3e832-71fb-4d71-b312-1e80f03597a1.aspx</comments>
      <category>ASP.NET MVC</category>
      <category>Moq</category>
    </item>
  </channel>
</rss>