daryllabar / DLaB.Xrm.XrmToolBoxTools

Plugins for the XrmToolBox
MIT License
78 stars 70 forks source link

Cannot run Via the Command Line PAC #508

Closed dtrybuch closed 4 months ago

dtrybuch commented 4 months ago

Tool and Version What tool/version is it that you're reporting a bug for? i.e. EarlyBoundGenerator V 2.2024.2.1

Describe the bug I want to build a pipeline to run your code via script to build entities in our environments. I used your docs: https://github.com/daryllabar/DLaB.Xrm.XrmToolBoxTools/wiki/EBG-%E2%80%90-Integrating-The-Early-Bound-Generator-Into-Your-Build-Pipeline#running-via-the-command-line-pac

I have a different path for tool: C:\Users{UserName}.dotnet\tools.store\microsoft.powerapps.cli.tool\1.33.5\microsoft.powerapps.cli.tool\1.33.5\tools\net6.0\any

I copied the folder and moved the file to the 'any' folder.

Unfortunately, I get an error:

Error: Model generation failed.
System.NotSupportedException: Could not load provider of type 'DLaB.ModelBuilderExtensions.CodeWriterFilterService,DLaB.ModelBuilderExtensions'
   at Microsoft.PowerPlatform.Dataverse.ModelBuilderLib.ServiceFactory.CreateInstance[TIService](TIService defaultServiceInstance, String parameterValue, ModelBuilderInvokeParameters parameters)
   at Microsoft.PowerPlatform.Dataverse.ModelBuilderLib.ServiceProvider.InitializeServices(ModelBuilderInvokeParameters parameters)
   at Microsoft.PowerPlatform.Dataverse.ModelBuilderLib.ModelBuilder.get_ServiceProvider()
   at Microsoft.PowerPlatform.Dataverse.ModelBuilderLib.ModelBuilder.get_IsLiveConnectionRequired()
   at bolt.module.modelbuilder.verbs.ModelBuilderVerb.ExecuteAsync(Command command, CancellationToken cancellationToken) in C:\__w\1\s\src\cli\bolt.module.modelbuilder\verbs\ModelBuilderVerb.cs:line 223

Should I do something else or copy it to a different place?

daryllabar commented 4 months ago

You're a few versions behind, but that shouldn't matter for this. In your any folder exists the PAC.exe? And in that same folder you have copied the DLaB.ModelBuilderExtensions.dll?

dtrybuch commented 4 months ago

It is in the folder named "shims". However, it still did not work if I copied there. However, I found out that I got the pac using the dotnet tool https://learn.microsoft.com/en-us/power-platform/developer/howto/install-cli-net-tool?tabs=windows.

It is not working here but if I take it from downloading the .msi file then it works as expected and as is written in docs: https://learn.microsoft.com/en-us/power-platform/developer/howto/install-cli-msi

So for now it is ok for me. Sorry for your time and thank you for responding!

daryllabar commented 4 months ago

I appreciate you raising the issue. Apparently I need to update the docs for this install method, since you're the second person that has ran into this issue.