Error Loading PX.Payroll.dll when publishing Customizations in 2022 R1 - Problem and Solution


Userlevel 6
Badge +4

Background

We hoped to upgrade from 2021 R1 to 2021 R2 last year, but other projects pushed the upgrade back when we ran into upgrade issues on the workflow.  However, I did preliminary work on the upgrade to get complete the development for testing with very little difficulty on the code side.  Since we ran into trouble with our UI based customization project for the new workflow engine, we focused on reworking our workflows to be coded in Visual Studio and never made it to the rollout of 2021 R2.  (This is important to know as it means the problem did not exist in upgrading from 2021 R1 to R2.)

Getting an Error

The time has come for us to upgrade to 2022 R1 (22.102.0054), and I ran into a rather peculiar problem.  While we do not use Payroll in Acumatica, I kept getting errors preventing publishing my customization project due to a problem with Payroll.

By going into the customization project and selecting Show Active Extensions on the Extension Library menu, the errors (or something very similar) that I saw when attempting to publish my project were displayed as shown here in red.

Failed to load types from assembly PX.Objects.PR, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null with message: Could not load file or assembly 'PX.Payroll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3b136cac2f602b8e' or one of its dependencies. The system cannot find the file specified.

Failed to load types from assembly PX.Payroll.WebServiceClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3b136cac2f602b8e with message: Could not load file or assembly 'PX.Payroll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3b136cac2f602b8e' or one of its dependencies. The system cannot find the file specified.

Fixing the Error

Upon further investigation, it appeared that my instance/bin folder was missing the aforementioned PX.Payroll.dll file.  Out of curiosity, I checked my Acumatica ERP installation in the files/bin folder which is the source of bin files copied to new instances, and it was not there either.  On a whim, I decided to run the installation again.  This time, already upgraded, the installation offered a Repair option, so I selected that option.  When finished, I magically had a PX.Payroll.dll file in my Acumatica ERP installation int he files/bin folder.  Oddly, while most DLL’s were dated 4/5/22, my PX.Payroll.dll file was dated 6/17/21.  Regardless, copying this file over to my instance/bin folder allowed the DLL to load, and my error went away.

Repeating the Problem

I maintain multiple development environments when attempting major version upgrades.  This issue occurred on my dev sandbox machine initially.  Having the 2021 R2 environment on my local (work tablet) dev machine, I upgraded to 2022 R1, restored snapshots and customization projects from my other dev machine where I had just “fixed” the Payroll dll issue.  Once again, the PX.Payroll.dll file was missing entirely from this second dev machine.  After copying the missing file from my first dev machine, the error went away on the second dev machine.

Not Consistently a Problem

My sysadmin maintains a “playground” environment where he tests my early project builds for upcoming major Acumatica version upgrades.  When he upgraded his instance, he had the PX.Payroll.dll file.  He found it odd that his file also had the 6/17/21 date, but it matched mine.  This tells me that not everyone is subject to this issue.  Hopefully, it won’t impact you.  However, if you try to upgrade to 2022 R1 and start getting errors about PX.Payroll, now you know what to do.

Happy coding!


19 replies

Userlevel 5
Badge +1

to confirm your visual studio project references PX.Payroll?

Assuming yes, my recommendation is to first confirm it is referencing the proper instances PX.Payroll. Second would be to make sure you are no allowing it to copy local. What is sounds like to me is that your project is not linking the PX.Payroll dll from the current instance but from another version. This is then copying the wrong file into your test instance. when you publish into a clean instance your DLL is looking for that specific version of PX.Payroll file and throwing an error. 

 

Userlevel 6
Badge +4

Shawn, I think you missed the point that made this so odd.  My project does not reference PX.Payoll and should not.  We do NOTHING with payroll.  That’s why I was so surprised to have payroll reporting an error.  The PX.Payroll.dll did not install with Acumatica when I ran the latest ERP installer, so it was not available to copy to my site when the upgrade process for my instance when I upgraded it.  (Apparently a couple of other DLL’s were installed by Acumatica with the upgrade that depend on PX.Payroll.dll.)  It was only after running a “repair” install of the ERP installer that it even copied the PX.Payroll.dll file to my machine.  Manually copying that DLL (which I do not use AT ALL) resolved the issue.   This appears to be a bug somewhere in the installation process to 2022 R1 as it happened to me both times I tried the upgrade on different machines, although my sysadmin did not have the same problem on his instance.

Since I don’t use Payroll, I won’t be adding a reference or including it in my project, so I won’t be copying it via my project either.  It never should have been an issue because our company flat out doesn’t do anything with Payroll in Acumatica as a user or developer.

Userlevel 5
Badge +1

sorry, I did miss that point.

Is there any change you are referencing any other Acumatica DLLs that do reference payroll? e.g. if any of the Acumatica DLLs that you do reference have their own references to Payroll and their Copy Local is set to true those sub references will get overwritten too. Its a long shot but worth looking at. The biggest issues I have relate to Newtonsoft and some of the dotnetCore files that then get copied into Acumatica and cause my whole instance to crash. Anything that you reference in your Visual Studio project that exists in the Acumatica BIN folder should have their Copy Local set to false to avoid this issue.

Userlevel 6
Badge +4

sorry, I did miss that point.

Is there any change you are referencing any other Acumatica DLLs that do reference payroll? e.g. if any of the Acumatica DLLs that you do reference have their own references to Payroll and their Copy Local is set to true those sub references will get overwritten too. Its a long shot but worth looking at. The biggest issues I have relate to Newtonsoft and some of the dotnetCore files that then get copied into Acumatica and cause my whole instance to crash. Anything that you reference in your Visual Studio project that exists in the Acumatica BIN folder should have their Copy Local set to false to avoid this issue.

Not intentionally.  As in, it would only be if Acumatica rerouted something like a user/employee to payroll, but I already checked where I found it most relevant… nope.  They didn’t.  Regardless, my point is that the upgrade process itself seemed to create a requirement for PX.Payroll.dll since my code only changed marginally to support compiling for 2022R1 rather than adding additional enhancements.  As per the error appearing in Show Active Extension, it seems to be due to inclusion of PX.Objects.PR and PX.Payroll.WebServiceClient by Acumatica where it was complaining about the missing PX.Payroll.

I’m simply sharing my experience and what I found to be required to resolve it in my case.  I’m not seeking a solution.  :)

Userlevel 5
Badge +1

ah, well then I guess I am “really missing the point” then :)

 

Userlevel 7
Badge +5

That seems to be a bug in the product. Please try installing/updating Acumatica without compilation:

 

Userlevel 6
Badge +4

That seems to be a bug in the product. Please try installing/updating Acumatica without compilation:

 

Thanks, Dmitrii!  That makes sense on why the sysadmin didn’t have the same problem.  I created a new instance on my 2 machines, but he upgraded his old instance directly.  I had the older version of Acumatica installed that I upgraded, but not the site.  I did see that checkbox and figured I’d better go with defaults of unchecked.

Userlevel 4
Badge

That seems to be a bug in the product. Please try installing/updating Acumatica without compilation:

 

Hello Dmitrii:

If you have already created the site, how can you avoid this error?

Every time I run a compilation, this error is back.

The fix that I have found for development purposes is click on Restart Application button on the Apply Updates screen.

Thank you for this!  I ran into it also.

Do we know when it may be fixed?

Userlevel 7
Badge

Hi @Dmitrii Naumov - any ideas for @rich88 and @anahizentella94 ? Thank you!

I have the same issue only when I “Publish with Cleanup”.

Userlevel 7
Badge +5

@Chris Hackett , @rich88 , @anahizentella94 

The engineering team is investigating the issue. It seems it may be related to same specific .Net Framework version/some other components, so it is not reproducible that easily. 

 

Maybe try to download the latest .Net Framework updates.

Scenario: Upgrading 21.205.0063 22.112.0018

(Upgrading local test machine, not production server)

.NET CORE Version 3.1.422 (dotnet.exe --version)
.NET Version 4.8.04084 (using regedit: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full)

  1. Downloaded and ran .msi to install 22.1
  2. Ran ERP Configuration → Application Maintenance → Upgrade
  3. Logged in and opened Customization and Published
  4. Received Errors about missing PX.Payroll.dll
     


We are having the exact issue as @Brian Stevens was having. We do not use the payroll module. We experienced the issue with a small customization we have written (no payroll references) and a third party customization (SPS Commerce). Both would not compile with the same error after the upgrade.

After doing the Repair that @Brian Stevens mentioned, I did end up finding the PX.Payroll.dll in the “Files” directory under the Acumatica install folder. The file had a 6/17/2021 file date on it. Interestingly, the version on the assembly is 1.0.0.0 and its copyright date is 2016. I copied that file manually to the bin folder of my instance and everything started compiling again.

@Brian Stevens We very much appreciate the solution and pointing us in the right direction. Saved me a ton of time and a call to our third party vendor which would have ended up in us going down a deep rabbit hole. I am hoping that Acumatica can address this install issue with the confirmation it is still happening and this additional information.

 

Userlevel 1

Having the same issue. We are just getting started, testing and validating our customizations in a 22R1 environment.

 

This version was released 6 months ago, @Brian Stevens pointed this out 5 months ago.

 

This is why we stagger upgrades, so kinks like this are worked out.

Userlevel 7
Badge +10

Just stumbled on this thread. I shared a report of this bug and a likely solution in private to one of the members of the payroll team three months ago, after having experienced this issue multiple times. Not sure if it has been filed and/or fixed at this point, but here it is in case someone from Acumatica want to give it a shot.

The root cause is the version number of PX.Payroll.DLL that is older in 2022 R1 than 2021. Due to the way Windows Installer handles upgrades and how the Acumatica MSI is designed, the file ends up being deleted instead of updated during the upgrade.


The solution for those impacted is to uninstall Acumatica manually, re-install the update and run the Upgrade site process again. You may also simply copy the missing file to the bin directory. Your project will publish just fine after that.

Userlevel 7
Badge

Thank you for sharing this @Gabriel Michaud !

Userlevel 4
Badge

Thank you everyone for reporting this issue. We were able to isolate the issue and it will be fixed in upcoming updates. The root of the problem was indeed in MSI file and version attributes.  This happened because the payroll libraries were moved to a separate repository with their own release cycle and file versions of the DLLs compiled from code repository would not increment correctly during build.

The new .msi installer logic in the upcoming updates will now always update the PX.Payroll.dll, ignoring the file version attribute. 

Userlevel 3
Badge

@Ali Jani how long until the next update is released that will have this fix? 

I have been testing upgrading from 2021 R2 to 2022 R2 and am experiencing this error. However, if I try the solution listed above for dropping the PX.Payroll.dll into the bin file from the older installation the website crashes. At this point I’d rather wait until the new release fixes this problem.

Userlevel 3
Badge

Edit to last post: I was able to make this work with the solution provided. I copied the PX.Payroll.dll into the wrong BIN folder I think. 

Correct Folder (Default path): 
C:\Program Files\Acumatica ERP\Customization\AcumaticaERP\AcumaticaERPValidation\AcumaticaERPWebsite\Bin

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved