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

Empty GUID During PluginRegistration #303

Open
YTKme opened this issue Mar 17, 2021 · 1 comment
Open

Empty GUID During PluginRegistration #303

YTKme opened this issue Mar 17, 2021 · 1 comment

Comments

@YTKme
Copy link

YTKme commented Mar 17, 2021

Hi Wael,

I've been using the PowerShell scripts you wrote for D365 automation along with Jenkins to do solution deployment, and mostly is been working well so far. (due to company security compliance, we are unable to use Azure DevOps).

One issue we've been unable to solve is how to automate plugin registration with PowerShell scripts. It seem like you currently have a few scripts for Plugin Automation, mainly GetPluginRegistration.ps1 for generating mapping files, and PluginRegistration.ps1 for registering plugins. I mirror some of the VSTS task script with some modification to use with Jenkins.

While testing the PluginRegistration.ps1 script in my development environment with PowerShell, I seem to be getting the following errors:

WARNING: Extracted id using plugin assembly name AlphaPlugin
VERBOSE: Trying to upsert AlphaPlugin / 00000000-0000-0000-0000-000000000000
Set-XrmPluginRegistration : Expected non-empty Guid.
At C:\Work\Tool\xRMCIFramework\PluginRegistration.ps1:40 char:1
+ Set-XrmPluginRegistration -RegistrationType $RegistrationType -Assemb ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-XrmPluginRegistration], FaultException`1
    + FullyQualifiedErrorId : System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral,  
   PublicKeyToken=31bf3856ad364e35]],Xrm.Framework.CI.PowerShell.Cmdlets.SetXrmPluginRegistration

I understand that it is missing the GUID, but I am not sure how it is specified.

On the code side, under the Properties of AssemblyInfo.cs, the GUID seem to be specified with:

[assembly: Guid("...")]

I also tried registering the plugin with and without a mapping file that I generated with GetPluginRegistration.ps1, but still getting the same error. I was wondering if I am missing something or doing something wrong?

The plugin assembly registers fine with the Plugin Registration Tool, but getting an error with the script.

UPDATE: I was able to get the plugin registered with the generated mapping file. But looking closer at the code for SetXrmPluginRegistration.cs, it seem like only the RegistrationType and AssemblyPath is required, and the other information can be generated. I tried it with just those 2 parameters, I get the same error of missing Guid.

@Ramunas9
Copy link

Ramunas9 commented Jun 4, 2024

Hello I have the same issue.
Problem is that you cannot create anything in dynamics without specifying GUID. Currently code requires you to specify GUID or entity that you are create must exist in dynamics with the same name. Then ir retrieves GUID from dynamics by name.
However, I need to create new e.g. Service Endpoint, but i do not have and do not whant to hardcode custom GUID, i would rather dynamics generate one for me.
Is there any options to do so?

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

2 participants