Is there a way to copy code from visual studio (C#) and paste it into OneNote, without losing the formatting?
I was able to do this, but only if I copy from VS, paste
Try this elegant solution directly from Microsoft: Productivity Power Tools 2015
https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProductivityPowerTools2015
The HTML copy-paste works nicely with OneNote.