Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom API Earlybound code splitting incorrectly #453

Open
MrCliffster opened this issue Mar 21, 2022 · 1 comment
Open

Custom API Earlybound code splitting incorrectly #453

MrCliffster opened this issue Mar 21, 2022 · 1 comment

Comments

@MrCliffster
Copy link

Problem: When generating Earlybound classes including Custom APIs the Custom API files are incomplete

After running earlybound.bat, spkl successfully generates the full suite of directories and files for Entities, Actions, and OptionSets as shown:
image
However, the class files for the individual Custom API actions are badly formed:
image
The key issue is the badly formed string on line 3, which is actually part of the serialisation attributes that crmsvcutil generates as shown on line 10453 in the monolithic file:
image

Suspected Cause

The regex that splits classes in CodeSplitter.cs is not correctly able to deal with the schema being provided by crmsvcutil as part of the DataContractAttribute shown in the third screenshot above. The schema namespace Namespace="http://schemas.microsoft.com/xrm/2011/new/" is unique to these Custom APIs in the monolithic EarlyBoundTypes.cs file that the tool outputs. I think a fix to the regex in Spkl's SourceCodeTypeExtractor.cs located here, specifically the ClassRegex, should alleviate this problem.

@MrCliffster
Copy link
Author

For those that stumble across this issue, the temporary workaround I use is to manually copy-paste the line that is broken into each custom action, each time I generate EBG files. The line is:
[System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.microsoft.com/crm/2011/Contracts")]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant