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

Nullable object must have a value error #454

Open
bwmodular opened this issue Mar 22, 2022 · 3 comments
Open

Nullable object must have a value error #454

bwmodular opened this issue Mar 22, 2022 · 3 comments
Assignees
Labels

Comments

@bwmodular
Copy link

Hi,
running instrument-plugin-code.bat on an environment which I've not run it against for a long time and I'm getting a 'Nullable object must have a value' error.

spkl v1.0.640
Dynamics 365 online 2022 release wave 1

Here are the logs:
Downloading Plugin/Workflow Activity Metadata
Searching for classes in 'C:\blah\Plugins\spkl..'
Found Plugin Type Registration blah.Plugins.AccountPlugin
Found Plugin Type Registration blah.Plugins.Account_CreateTMExtractRecord
The application terminated with an error.
Nullable object must have a value.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at SparkleXrm.Tasks.DownloadPluginMetadataTask.AddPluginAttributes(OrganizationServiceContext ctx, CodeParser parser, String pluginType)
at SparkleXrm.Tasks.DownloadPluginMetadataTask.ExecuteInternal(String filePath, OrganizationServiceContext ctx)
at SparkleXrm.Tasks.BaseTask.Execute(String folder)
at SparkleXrmTask.Program.RunTask(CommandLineArgs arguments, IOrganizationService service, ITrace trace)
at SparkleXrmTask.Program.Run(CommandLineArgs arguments)
at SparkleXrmTask.Program.Main(String[] args)
Error Code=1

I have run deploy-plugins.bat previously and that works ok.

Any ideas what might be causing this?

I can't see any issue with the plugin/step that it seems to be failing on.

Thanks as ever....

@scottdurow
Copy link
Owner

I'll take a look into this!

@scottdurow scottdurow self-assigned this Mar 22, 2022
@scottdurow scottdurow added the bug label Mar 22, 2022
@ALRobilliard
Copy link

I can't figure out why, but it's something to do with the Async/Sync mode of the step. I'm getting the same error as @bwmodular when instrumenting async plugins, but it works fine with sync.

To progress I'm:

  1. Converting all my async plugin steps to sync
  2. Running instrument-plugin-code.bat
  3. Updating the generated CrmPluginRegistration back from sync to async
  4. Run deploy-plugins.bat to fix all the steps in my environment

@samalex1701
Copy link

samalex1701 commented Aug 11, 2022

I'm getting the same error. VS 2019 with spkl Task Runner v1.0.640.1. I've tested both with On Prem CRM v8.2.28.11 and Online v9.2.22071.176 both with same results. As @ALRobilliard suggested I can change already deployed plugins to Synchronous and the Instrument-plugin-code.bat runs, but being set to Async gives the error. Thus far I've had mixed results deploying plugins set to Sync or ASync, but it seems to work with the online 9.2 more consistently.

Downloading Plugin/Workflow Activity Metadata
Searching for classes in 'C:\Users*\source\repos**\spkl..'
Found Plugin Type Registration *****
The application terminated with an error.
Nullable object must have a value.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at SparkleXrm.Tasks.DownloadPluginMetadataTask.AddPluginAttributes(OrganizationServiceContext ctx, CodeParser parser, String pluginType)
at SparkleXrm.Tasks.DownloadPluginMetadataTask.ExecuteInternal(String filePath, OrganizationServiceContext ctx)
at SparkleXrm.Tasks.BaseTask.Execute(String folder)
at SparkleXrmTask.Program.RunTask(CommandLineArgs arguments, IOrganizationService service, ITrace trace)
at SparkleXrmTask.Program.Run(CommandLineArgs arguments)
at SparkleXrmTask.Program.Main(String[] args)
Error Code=1

jklosinski pushed a commit to jklosinski/SparkleXrm that referenced this issue Aug 12, 2022
Fixing issue scottdurow#454. DownloadPluginMetadataTask.AddPluginAttributes would throw an exception on async plugin tasks because the LINQ projection forgot to include the AsyncAutoDelete attribute.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants