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

Possible to generate from a serialized file instead of talking with XRM api. #35

Open
pksorensen opened this issue Dec 5, 2020 · 2 comments

Comments

@pksorensen
Copy link
Member

I assume that XrmContext retrieve all the metadata from API. I would like to be able to extract that separately and serialize it to a file format.

  1. What is the actual retrieve calls that XrmContext calls?

and then i would like to call XrmContext --file myserializeddata.xml to generate the context.

  1. How easy would this be to add?

The reason is that i would from within a plugin in an solution do the extract and then post the serialized content to an external service that generates the dll and publish as a nuget - and i dont need to give CRM credentials to the external service that generates the dll.

@magesoe - is it possible? :)

@misoeli
Copy link
Member

misoeli commented May 31, 2021

@pksorensen the flag is technically there (save / load respectively), but save doesn't seem to work. It's done for XRMDT though, so it should be possible.

For future reference:
Parameter added to GenerateCSharpContext extraArguments: "save", "test.tmp"
Error dump:
(2021-05-31 14:39:08Z) [Info]: Retrieving CRM version...Done!

(2021-05-31 14:39:08Z) [Error]: Unable to generate context file: Encountered unexpected namespace 'http://schemas.microsoft.com/xrm/2011/Metadata'. The namespace must be empty.

(2021-05-31 14:39:08Z) [Error]: Parameter name: ns

System.Exception: DG XrmContext failed
at DG.Daxif.Common.Utility.postProcess(Int32 code, String es, String os, ConsoleLogger log, String proc) in C:\git\Daxif\src\Delegate.Daxif\Common\Utility.fs:line 173
at DG.Daxif.Modules.Solution.Main.updateCustomServiceContext(Environment env, String outputDirectory, String pathToExe, LogLevel log, FSharpList1 solutions, FSharpList1 entities, FSharpList`1 extraArgs) in C:\git\Daxif\src\Delegate.Daxif\Modules\Solution\Main.fs:line 312
at <StartupCode$FSI_0007>.$FSI_0007.main@() in C:\git\DG\DemoProject\XrmOrg\XrmOrg.XrmSolution\Tools\Daxif\GenerateCSharpContext.fsx:line 11
Stopped due to error

@pksorensen
Copy link
Member Author

@Xephyz also played around some stuff related to this.

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

No branches or pull requests

2 participants