{"id":20333231,"url":"https://github.com/devkeydet/code-first-fusion-example","last_synced_at":"2026-05-10T10:53:27.843Z","repository":{"id":45307798,"uuid":"440150844","full_name":"devkeydet/code-first-fusion-example","owner":"devkeydet","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-22T15:17:08.000Z","size":378,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-14T15:51:54.566Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devkeydet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-20T11:46:38.000Z","updated_at":"2021-12-20T18:43:00.000Z","dependencies_parsed_at":"2022-09-21T09:53:46.983Z","dependency_job_id":null,"html_url":"https://github.com/devkeydet/code-first-fusion-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkeydet%2Fcode-first-fusion-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkeydet%2Fcode-first-fusion-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkeydet%2Fcode-first-fusion-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkeydet%2Fcode-first-fusion-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devkeydet","download_url":"https://codeload.github.com/devkeydet/code-first-fusion-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241852146,"owners_count":20030966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T20:29:54.526Z","updated_at":"2026-05-10T10:53:22.813Z","avatar_url":"https://github.com/devkeydet.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Power Platform CLI (pac) Code First / Fusion Test\nExample of starting with an empty repo, using **pac** cli to start, and incorporating things that only happen in the service / solution. My goal was to start from scratch, perform as much **code first** as possible, use **pac** unless there is no pac capability to do something, and do things in make.powerapps.com only when necessary.  \n\nCode first elements include:\n* .NET Plugin\n* PCF Component\n\nElements autored in the service (make.powerapps.com):\n* Custom API\n* Table/Form/MDA\n\n[TODO: Document more detailed repro steps to build from scratch using pac.]\n\n# INTIAL SETUP WITH PLUGIN/CUSTOM API\nAt a high level, the proces was...\n\nupdate gitignore to ensure we don't commit files we don't want in the repo\n```\n# certain unpacked dataverse solution files\n**/Controls/*/*\n!**/Controls/*/ControlManifest.xml.data.xml\n**/PluginAssemblies/**/*.dll\n\n# export-unpack.ps1 puts things in a temp directory ignore in case delete part of script fails\n/temp\n```\n\ncreate folders: src/solutions/CodeFirstFusionExample\n\n**pac solution init** in the CodeFirstFusionExample solution folder\n\nrename 'src' subdirectory to 'unpacked-solution' (preference for clarity)\n\nedit CodeFirstFusionExample.cdsproj: replace 'src' text in SolutionRootPath element to 'unpacked-solution'\n\nedit CodeFirstFusionExample.cdsproj: enable SolutionPackageType to Both\n\n**dotnet build** in the CodeFirstFusionExample solution folder\n\n**pac solution import** of the unmanaged zip file in the bin/debug folder\n\ncreate folders: src/solutions/CodeFirstFusionExample/plugins/CodeFirstFusionExample.Plugins\n\n**pac plugin init**\n\nauthor plugin in VSCode\n\n**dotnet build** in the CodeFirstFusionExample.Plugins folder\n\ndeploy plugin with plugin registration tool\n\nadd plugin assembly to deployed unmanaged solution in make.powerapps.com\n\nin powershell set:\n```\n$solutionName = \"CodeFirstFusionExample\"\n```\n\nExport/Unpack metadata from changes made in make.powerapps.com\n```\n. .\\export-unpack.ps1\n```\n\nIn CodeFirstFusionExample solution folder run: **pac solution add-reference -p plugins\\CodeFirstFusionExample.Plugins**\n\nAt this point, the dll does not get copied from within the plugins\\CodeFirstFusionExample.Plugins folder to the unpacked-solution/PluginAssemblies folder structure of the unpacked solution.  You can validate this by deleting the dll.  If you do, **dotnet build** will fail. To address this, edit the **CodeFirstFusionExample.cdsproj** file, adding this under the **ItemGroup** with the **ProjectReference** to the **plugin csproj**.\n```\n\u003c!-- Manually added to ensure plugin dll gets copied before solution pack --\u003e\n  \u003cTarget Name=\"CopyPluginAssemblies\" AfterTargets=\"ResolveReferences\"\u003e\n    \u003cMessage Text=\"Copying plugin assemblies...\" Importance=\"high\"/\u003e\n    \u003cCopy\n      SourceFiles=\"plugins\\CodeFirstFusionExample.Plugins\\bin\\$(Configuration)\\$(TargetFramework)\\CodeFirstFusionExample.Plugins.dll\"\n      DestinationFiles=\"unpacked-solution\\PluginAssemblies\\CodeFirstFusionExamplePlugins-9732BB82-293C-440C-ADE7-306240D9AAD5\\CodeFirstFusionExamplePlugins.dll\" /\u003e\n      \u003c!-- Note that Dataverse doesn't support dll names with '.' in them.  Therefore, destination dll has the '.'' removed --\u003e\n  \u003c/Target\u003e\n```\nNOTE: your **DestinationFiles** path will be different because you will have a different GUID\n\nrun **dotnet build** in CodeFirstFusionExample solution folder (dll should now get copied into the unpacked-solution/PluginAssemblies folder structure of the unpacked solution )\n\nAdded custom api to unmanaged solution using make.powerapps.com to expose plugin logic\n\nExport/Unpack metadata from changes made in make.powerapps.com\n```\n. .\\export-unpack.ps1\n```\n\nrun **dotnet build** in CodeFirstFusionExample solution folder (sanity check)\n\n# ADD PCF COMPONENT\n\ncreate folders: src/solutions/CodeFirstFusionExample/pcf-components\n\nwithin pcf-components folder, run **pac pcf init -n DynamicTextInput -ns CodeFirstFusionExample -t field**\n\nif you get an error during **npm install**, run **npm install** again\n\nimplement component\n\ntest component locally\n\n**pac solution add-reference -p pcf-components** in CodeFirstFusionExample solution folder\n\n**pac solution import** of the unmanaged zip file in the bin/debug folder\n\nusing make.powerapps.com, create table CodeFirstPcfTest, create model-driven app, add table to mda, add component to main form in mda\n\nExport/Unpack metadata from changes made in make.powerapps.com\n```\n. .\\export-unpack.ps1\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevkeydet%2Fcode-first-fusion-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevkeydet%2Fcode-first-fusion-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevkeydet%2Fcode-first-fusion-example/lists"}