Skip to main content



No record found.

Dynamics 365 Community / Forums / Finance forum / Error on production bu...
Finance forum
Suggested answer

Error on production but not on development

Posted on by 140

Hi there, 

We have functionality that resets a password for a webuser. We use the class CryptoServiceProvider to generate salt and generate secure password hash codes. 

All our environments were recently updated to Platform release Update29, Application release 10.0.5.

When I run the code in our development environment, the password is reset and no error is thrown. 

When I run the same functionality in Production and UAT, it throws an error: 

Error executing code: Wrong type of argument for conversion function.

The code is very simple: 

this.UserPasswordIterations = 1000;
this.UserPasswordSalt = CryptoServiceProvider::generateSalt();
this.UserPasswordHash = CryptoServiceProvider::computeSaltedHash(_newPassword,this.UserPasswordSalt,this.UserPasswordIterations);

The catch is that it runs through the complete code and updates the password correctly. We just need the error to go away because the same functionality is used with integration. When integrating, integration sends back a fail response because of this error. 

All the code is exactly the same across all environments as we are using Azure DevOps for code and deployment. 

Does anyone have any idea how I can narrow down what causes this error? 

  • Sukrut Parab Profile Picture
    Sukrut Parab 71,643 Moderator on at
    RE: Error on production but not on development

    Try to reproduce it in UAT environment . There might be some difference the way it works in UAT , PROD vs Dev machines . If you can reproduce it in UAT ,  you should be able to debug it by connecting your dev VM to UAT environment.

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: Error on production but not on development

    This functionality is used in the standard application in a couple of places, for example on HCMWorker form (Human Resources - Workers- Workers - Time registration tab page), to set PIN code of the worker.

    I suggest you try to reproduce it in the standard application, and create a support request for Microsoft.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,989 Super User

Martin Dráb Profile Picture

Martin Dráb 225,588 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans