Friday, July 20, 2018

Sitecore Experience Commerce - Errors generating the Sitecore Service Proxy

As I had created a custom API in the Experience Commerce engine, I was required to rebuild the Sitecore Commerce Service proxy (Sitecore.Commerce.ServiceProxy). This led to a couple of issues on rebuild:
CS0756 A partial method may not have multiple defining declarations
This can be resolved by opening the ConnectedService.json file for the affected engine environment (ops or shops) and editing the GeneratedFileNamePrefix setting. In my case this had incorrectly changed itself to Reference when it should have been CommerceOps (or CommerceShops). You should also delete the the reference.cs file which was generated.

Another error may also occur:
The namespace 'Sitecore.Commerce.Plugin.CacheWatcher' already contains a definition for 'ExtensionMethods'
Again this points back to the ConnectedService.json file for CommerceOps. The UseNameSpacePrefix should be set to true and NamespacePrefix set to "CommerceOps".

This should now generate the ServiceProxy DLL as expected with no errors.

No comments:

Post a Comment