Before publishing the application or creating setup files remove the unused NUGET packages from the solutions and do a rebuild.