none
System.Security.Cryptography.CryptographicException: Key not valid for use in specified state.

    Question

  • I am new to MVC, i am using VS 2012 in windows 7. my problem is when i Compile my application I got an Error "System.Security.Cryptography.CryptographicException: Key not valid for use in specified state."

    does any one know what does this error mean? & How could i Solve it

    Thanx in Advance.

    Wednesday, October 31, 2012 7:30 AM

All replies

  • Hi Hardik28,

    Is this a deployment question? You said your problem occurs when compiling your application.

    Could you please elaborate the problem? Are you working with a WinForm application, ASP.NET application, or something else? Which code did you get the error?

    Best regards,


    Chester Hong
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, November 01, 2012 5:47 AM
  • Hi Chester,

    Thanx for reply,

    This is an Asp.Net Application. My problem starts when I press F5 and when It will go for getting a connection with a database, just that time I got this Error. I have also tried to find the solution on net everywhere i got same answer that it was the problem of machine key, & after deleting it problem should be solved. but i haven't tried it b'coz this application is in underdevelopment & if I delete machine key then it may create some serious problem. so, IF you know any other way to solve it then plz. tell me.

    "This problem occurs only in my computer, application is working proper in other computers.so, does it mean that I have some configuration problem in my computer?"

    Waiting for your reply.

    Thank You.

    Monday, November 05, 2012 4:05 AM
  • Hi Hardik28,

    Thanks for your information.

    However, this is Windows Forms forum and we do not support ASP.NET questions here. You can try ASP.NET forum: http://forums.asp.net/

    There will be more experts to help you.

    Sorry for any inconvenience.

    Best regards,


    Chester Hong
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, November 05, 2012 7:51 AM