powerplatform-vscode icon indicating copy to clipboard operation
powerplatform-vscode copied to clipboard

'pac solution clone' removing period symbols from plugin assemblies and causing cdsproj build failure

Open RajeevPentyala opened this issue 1 year ago • 2 comments

  • [ ] Please attach a sample .msapp to this Issue which demonstrates the issue you are experiencing. (Please do not attach any file which may contain sensitive personal or company data.)

Describe the bug

I am on 1.23.4 version of pac cli. We have a Dataverse solution with a 'Plugin Assembly' and the assembly name has a period (.) symbol (i.e., AutoCoE.Extensibility.Plugins).

image

  • When triggered the 'pac solution clone', plugin dll file got generated without the period symbols.

image

  • I went ahead and added the plugin project (i.e., .csproj) to the cdsproj using 'pas solution add-reference' command.

  • Finally built the cdsproj and got following 'Build FAILED' error.

[error]C:\Users\VssAdministrator.nuget\packages\microsoft.powerapps.msbuild.solution\1.24.3\build\Microsoft.PowerApps.MSBuild.Solution.targets(137,5): Error : Cannot find required file '..\SolutionPackage\obj\Debug\Metadata\PluginAssemblies\AutoCoEExtensibilityPlugins-C8F4F22D-C74C-4D46-B206-8EEE6F084E4F\AutoCoEExtensibilityPlugins.dll'. C:\Users\VssAdministrator.nuget\packages\microsoft.powerapps.msbuild.solution\1.24.3\build\Microsoft.PowerApps.MSBuild.Solution.targets(137,5): error : Cannot find required file '..\SolutionPackage\obj\Debug\Metadata\PluginAssemblies\AutoCoEExtensibilityPlugins-C8F4F22D-C74C-4D46-B206-8EEE6F084E4F\AutoCoEExtensibilityPlugins.dll'. [..\SolutionPackage\AutomationCoESatellite.cdsproj] Done Building Project "D:\a\1\s\cat fusion\AutomationCoESatellite\SolutionPackage\AutomationCoESatellite.cdsproj" (build target(s)) -- FAILED.

A clear and concise description of what the bug is. Please mention if it is reproduced using PAC CLI or PASopa. (Please mention the version number, if possible)

To Reproduce

Steps to reproduce the behavior:

  • Clone a Dataverse solution with a plugin assembly having period '.' symbol in the name.
  • Add the plugin .csproj file to the generated cdsproj file using 'pac solution add-reference' command.
  • Build the .cdsproj file.

Screenshots

If applicable, add screenshots of error messages to help explain your problem.

Additional context

'pac solution clone' works fine if the plugin assembly name does not have period symbols.

RajeevPentyala avatar Jun 16 '23 10:06 RajeevPentyala

It looks like this is not supported scenario. You are doing solution clone which already has a plugin plus adding reference to the same plug in again. We can provide better error message at the time of add-reference call to indicate this is not supported but it will still error out.

petrochuk avatar Jun 27 '23 14:06 petrochuk

It looks like this is not supported scenario. You are doing solution clone which already has a plugin plus adding reference to the same plug in again. We can provide better error message at the time of add-reference call to indicate this is not supported but it will still error out.

@petrochuk Let's take a scenario where the plugin assembly was initially registered with PRT, but later the decision was made to switch to ALM. In this case, the Dataverse solution already includes the Plugin assembly, while my repository contains a C# project for the plugin. To handle this situation, I intend to clone the solution first and then add a reference to my C# project. Please provide guidance on the best approach for handling this scenario.

RajeevPentyala avatar Jul 13 '23 06:07 RajeevPentyala