Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to stop Visual Studio adding 'throw new NotImplementedException' on new functions? Causes namespace conflicts with Unity

Yes, I know this is good practise normally but the problem in Unity is it causes the System namespace to be added which breaks several Unity classes such as Random unless I fully qualify them which is tedious :). Is there any way to disable it from adding the throw? I've tried searching for a snippet for it but have drawn a blank. This happens when doing 'Generate Method' from Alt-Enter after typing in 'DoSomething();'

enter image description here

like image 794
Simon Storr Avatar asked Sep 16 '25 02:09

Simon Storr


1 Answers

Yes, you can change this default behavior by changing the snippet that creates it. That snippet is located at the following location: (caveat...this will change it across the board for VS2017)

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC#\Snippets\1033\Refactoring\MethodStub.snippet

like image 138
user1011627 Avatar answered Sep 19 '25 15:09

user1011627