Clearly, the Asgardians had the technology for projectile weapons, and reasons to have them (Dark Elves, Chitauri, etc.). It must then be the case then that they did not want to use such weapons, at least for personal combat.
Asgardians live and die by honor. To Asgardians, swords are more honorable (ethical) than guns.
A human analogy might be hollow-point bullets, which have been prohibited for use in war as far back as the Hague Convention of 1899. Hollow-points are very effective at causing pain and death, and they would make war far more painful for your opponent. They are in the technical sense better, yet most nations adhere to this ban, and many (most?) people agree they are "more unethical" to use in war.
The Anti-Ballistic Missile Treaty is another human example of intentionally limiting weapons, even though it may give a surprise advantage to your less scrupulous enemy.
Asgardians, like humans, deliberately chose to not use technically superior weapons.