Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8087621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:50:13+00:00 2026-06-05T18:50:13+00:00

I’m getting an Unable to obtain public key for StrongNameKeyPair. exception using Newtonsoft’s JsonConvert.SerializeObject

  • 0

I’m getting an “Unable to obtain public key for StrongNameKeyPair.” exception using Newtonsoft’s JsonConvert.SerializeObject method in my asp.net application. It works locally but not on our test server. (if you know why, help me out at http://json.codeplex.com/workitem/22692) 🙂

I found Unable to obtain public key for StrongNameKeyPair and a few other posts that mentioned changing the permissions on the C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys directory, but is that secure and would my network administrator even let me do that?

EDIT: Here’s a stack trace:
3eUnable to obtain public key for StrongNameKeyPair.
System.ArgumentException
at System.Reflection.StrongNameKeyPair.ComputePublicKey()
at System.Reflection.StrongNameKeyPair.get_PublicKey()
at System.Reflection.Emit.AssemblyBuilder..ctor(AppDomain domain, AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark& stackMark, IEnumerable1 unsafeAssemblyAttributes, SecurityContextSource securityContextSource)
at System.Reflection.Emit.AssemblyBuilder.InternalDefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark& stackMark, IEnumerable
1 unsafeAssemblyAttributes, SecurityContextSource securityContextSource)
at System.AppDomain.InternalDefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark& stackMark, IEnumerable`1 assemblyAttributes, SecurityContextSource securityContextSource)
at System.AppDomain.DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access)
at Newtonsoft.Json.Utilities.DynamicWrapper.Init()
at Newtonsoft.Json.Utilities.DynamicWrapper.GenerateWrapperType(Type interfaceType, Type underlyingType)
at Newtonsoft.Json.Utilities.DynamicWrapper.GetWrapper(Type interfaceType, Type realObjectType)
at Newtonsoft.Json.Utilities.DynamicWrapper.CreateWrapper[T](Object realObject)
at Newtonsoft.Json.Converters.EntityKeyMemberConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable(JsonWriter writer, JsonConverter converter, Object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)
……

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:50:14+00:00Added an answer on June 5, 2026 at 6:50 pm

    I found this post: http://ayende.com/blog/1441/unable-to-obtain-public-key-for-strongnamekeypair and I’m thinking that if Ayende Rahien posted it, it’s a good answer.

    I also only gave Everyone read and write permissions and it worked (the server may have been restarted, but I don’t know for sure if it was or if that helped).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.