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

`pac solution add-reference` does not work with Dependent Assembly plugin project

Open mannybellas opened this issue 2 years ago • 2 comments

Calling pac solution pack (version: 1.19.4+gfbe2fd6) with mapping file does not map pluginpackages. To reproduce:

  1. pack plugin init a new plugin and build it
  2. open plugin registration tool pac tool prt and choose "Register New Package" to upload the nupkg created at step 1
  3. Ensure the Plugin Package has been added to your solution, export and unpack the solution using pac solution export and pac solution unpack
  4. pack the solution using pac solution pack -m mapping.xml -etcetc where the mapping.xml file contains the an entry similar tot he following:
<FileToFile 
	map="prefix_XXXXXXXX.nupkg" 
	to="..\..\PATH_TO_PLUGIN_PROJECT\bin\Release\XXXXXXXX.1.0.0.nupkg" 
/>  

or

<FileToFile 
	map="pluginpackages\prefix_XXXXXXXX\package\prefix_XXXXXXXX.nupkg" 
	to="..\..\PATH_TO_PLUGIN_PROJECT\bin\Release\XXXXXXXX.1.0.0.nupkg" 
/>  

mannybellas avatar Nov 15 '22 23:11 mannybellas

On further investigation, this obviously not the way to add a dependent assembly package to a solution. The correct way is to have a cdsproject and use pac solution add-reference.

When using pac solution add-reference to a plugin project, it appears this only works for plugin assembly. How do you add-reference and tell it to use the nupkg?

mannybellas avatar Mar 02 '23 05:03 mannybellas

Did you find a solution? I did not find a documentation on how to build and reference the packages correctly. I think i will use assemblies instead of nupkg.

DominicBoettger avatar Jan 18 '24 16:01 DominicBoettger