Hello,
Welcome to Microsoft Q&A!
@SmilingMoon You could try to add <Target Name="ResolvePackageDependenciesForBuild" />
this into the project file of the packaging project.
Like this:
<ItemGroup>
<ProjectReference Include="..\TestUWP\TestUWP.csproj" />
</ItemGroup>
<Target Name="ResolvePackageDependenciesForBuild" />
</Project>
After adding this, I could run your sample correctly without exceptions.
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.