D365 Retail

Field notes on Dynamics 365 Commerce & Retail

All articles
CRTRetail ServerExtensions

Renaming a CRT Entity in Extensions Without Breaking the Retail Server Proxy Build

10 September 20181 min readHitesh Manglani

Based on the 7.1 Retail SDK.

Renaming or refactoring a Commerce Runtime (CRT) entity that inherits from CommerceEntity — say, from OldEntityName to NewEntityName — breaks the build of your Retail Server extension assembly. The RetailProxy classes are generated from the old entity definition, and the build fails with errors like:

Could not load type OldEntityName from assembly...

along with a failure in the bin\CommerceProxyGenerator.exe step.

Retail Proxy Error

The fix

The trick is doing the rename in two passes instead of one:

  1. Compile the CRT data DLLs with OldEntityName still present in the References folder.
  2. Comment out every reference to NewEntityName in the Retail Server extension assembly, then do a clean build of the solution.
  3. Once that build succeeds with no errors, uncomment all the NewEntityName references in the Retail Server extension assembly.

This gets the proxy generator working against a known-good state before reintroducing the new name, instead of fighting a build that's trying to resolve both names at once.

More on this topic

Stuck on a D365 Commerce issue?

If you need hands-on help with MPOS, CRT extensions, or a Retail deployment, get in touch — I still build these things.

Talk to me