XrmContext
XrmContext copied to clipboard
Possible to generate from a serialized file instead of talking with XRM api.
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.
- What is the actual retrieve calls that XrmContext calls?
and then i would like to call XrmContext --file myserializeddata.xml to generate the context.
- 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? :)
@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, FSharpList
1 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
@Xephyz also played around some stuff related to this.