Title
pp-entity creation should fail input validation when solution metadata root is missing
Summary
Creating a pp-entity in an empty output folder currently reaches post-actions and fails late in AddEntityToSolutionXml.ps1 because Other/Solution.xml is missing. This should be rejected during input validation before scaffolding starts.
Steps to Reproduce
- Create an empty folder:
temp/txc-entity-demo
- Run:
txc ws comp create pp-entity \
-o temp/txc-entity-demo \
--param Behavior=New \
--param LogicalName=temporaryentity \
--param LogicalNamePlural=temporaryentities \
--param DisplayName='Temporary Entity' \
--param DisplayNamePlural='Temporary Entities' \
--param PublisherPrefix=tmp
Actual Result
- Output says template creation started/succeeded.
- Post-action
AddEntityToSolutionXml.ps1 fails because ./Other/Solution.xml does not exist.
- Operation rolls back after doing work.
Representative error:
Cannot find path '.../temp/txc-entity-demo/Other/Solution.xml' because it does not exist.
Post-action(s) failed, all changes rolled back: Adding entity to solution.xml
Expected Result
The CLI should fail during input validation with a clear message before scaffolding:
- Required structure is missing (for example
Other/Solution.xml).
- User must create/initialize a proper solution first, then run
pp-entity creation.
Proposed Change
Add pre-flight validation for pp-entity creation:
- Validate output target contains a valid solution metadata root.
- If validation fails, stop immediately with non-zero exit code.
- Return a direct, actionable error, for example:
- "Invalid target folder for pp-entity: missing Other/Solution.xml. Initialize or create a solution structure first."
Title
pp-entity creation should fail input validation when solution metadata root is missing
Summary
Creating a
pp-entityin an empty output folder currently reaches post-actions and fails late inAddEntityToSolutionXml.ps1becauseOther/Solution.xmlis missing. This should be rejected during input validation before scaffolding starts.Steps to Reproduce
temp/txc-entity-demoActual Result
AddEntityToSolutionXml.ps1fails because./Other/Solution.xmldoes not exist.Representative error:
Expected Result
The CLI should fail during input validation with a clear message before scaffolding:
Other/Solution.xml).pp-entitycreation.Proposed Change
Add pre-flight validation for
pp-entitycreation: