0

We are trying to generate the custom model json using a simple console application but getting error below error: The type initializer for XConnectModel.UserModel threw an exception.

We are using Sitecore 10.1.

For reference we have added a snapshot as well as a sample application which you can run and check.

enter image description here

UserModel.cs looks like below-

enter image description here

And PulsePoll.cs file has below code-

enter image description here

Please help us in detecting the issue.

Note: we have crossed check the code implementation using this link: https://doc.sitecore.com/xp/en/developers/102/sitecore-experience-platform/create-a-custom-model.html

5
  • Can you share the content of your other classes please? PulsePoll.cs and UserModel.cs Oct 9, 2023 at 10:00
  • @DeanOBrien I updated the question with the detail you asked. Thanks. Oct 9, 2023 at 10:54
  • Please try making your PulsePoll() empty constructor public not private Oct 9, 2023 at 12:14
  • Also - please switch to use text rather than images in your question for SEO purposes Oct 9, 2023 at 12:35
  • Did you ever try switching to public constructor? Nov 7, 2023 at 20:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.