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 1928718
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T07:00:49+00:00 2026-05-17T07:00:49+00:00

We (our IT partner really) recently changed some DNS for a web farmed site

  • 0

We (our IT partner really) recently changed some DNS for a web farmed site we have, so that the two production server have round-robin DNS switching between them. Prior to this switch we didn’t really have problems with WebResource.axd files. Since the switch, when we hit the live public URL, we get an error:

CryptographicException

Padding is invalid and cannot be removed.

When we hit the specific servers themselves, they load fine. I’ve researched the issue and it seems since they’re sharing assets between two servers, we need to have a consistent machineKey in the web.config for each server so they can encrypt and decrypt consistently between the two. My questions are:

  1. Can I generate a machineKey via a tool on the server, or do I need to write code to do this?
  2. Do I just need to add the machineKey to the web.config on each server or do you think I’ll need to do anything else to make the two server work together? (Both web.config‘s currently do not have a machineKey)
  • 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-05-17T07:00:49+00:00Added an answer on May 17, 2026 at 7:00 am

    This should answer:

    How To: Configure MachineKey in ASP.NET 2.0 – Web Farm Deployment Considerations

    Web Farm Deployment Considerations

    If you deploy your application in a Web farm, you must ensure that the
    configuration files on each server share the same value for
    validationKey and decryptionKey, which are used for hashing and
    decryption respectively. This is required because you cannot guarantee
    which server will handle successive requests.

    With manually generated key values, the settings should
    be similar to the following example.

    <machineKey  
    validationKey="21F090935F6E49C2C797F69BBAAD8402ABD2EE0B667A8B44EA7DD4374267A75D7
                   AD972A119482D15A4127461DB1DC347C1A63AE5F1CCFAACFF1B72A7F0A281B"       
    
    decryptionKey="ABAA84D7EC4BB56D75D217CECFFB9628809BDB8BF91CFCD64568A145BE59719F"
    validation="SHA1"
    decryption="AES"
    />
    

    If you want to isolate your application from other applications on the
    same server, place the in the Web.config file for each
    application on each server in the farm. Ensure that you use separate
    key values for each application, but duplicate each application’s keys
    across all servers in the farm.

    In short, to set up the machine key refer the following link:
    Setting Up a Machine Key – Orchard Documentation.

    Setting Up the Machine Key Using IIS Manager

    If you have access to the IIS management console for the server where
    Orchard is installed, it is the easiest way to set-up a machine key.

    Start the management console and then select the web site. Open the
    machine key configuration:
    The IIS web site configuration panel

    The machine key control panel has the following settings:

    The machine key configuration panel

    Uncheck “Automatically generate at runtime” for both the validation
    key and the decryption key.

    Click “Generate Keys” under “Actions” on the right side of the panel.

    Click “Apply”.

    and add the following line to the web.config file in all the webservers under system.web tag if it does not exist.

    <machineKey  
        validationKey="21F0SAMPLEKEY9C2C797F69BBAAD8402ABD2EE0B667A8B44EA7DD4374267A75D7
                       AD972A119482D15A4127461DB1DC347C1A63AE5F1CCFAACFF1B72A7F0A281B"           
        decryptionKey="ABAASAMPLEKEY56D75D217CECFFB9628809BDB8BF91CFCD64568A145BE59719F"
        validation="SHA1"
        decryption="AES"
    />
    

    Please make sure that you have a permanent backup of the machine keys and web.config file

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

Sidebar

Related Questions

Our company runs a web site (oursite.com) with affiliate partners who send us traffic.
Our ASP.NET 3.5 website running on IIS 6 has two teams that are adding
Our application is interfacing with a lot of web services these days. We have
I'm working on a Web Service project to provide data to a partner. Our
A partner of ours is making a call to a web service that includes
Our team has some code guidelines that I would like to enforce via stylecop
I have a snippet to create a 'Like' button for our news site: <iframe
My company has partners that embed a few of our web pages into their
Our dev shop currently uses Visual SourceSafe. We all know how that could end
Our web services are distributed across different servers for various reasons (such as decreasing

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.