Update: If you are having issues with the “Create Unit Tests…” function being disabled, check out this post.
If you have followed from my previous workaround to enable “Create Unit Tests…”, you might be delighted that there’s a permanent solution to this issue.
There are two ways to fully enable “Create Unit Tests…” on Visual Studio 2012 without using keyboard shortcuts or command window. Better still, you can now right click –> Create Unit Tests… as could be seen below:

There are two ways to enable this, the elegant way or the abnormal way.
Solution 1: The Elegant Way
This solution is rather easy. All you need to do is just download the vssettings file below and add it into settings. Follow these steps:
- Download the following file: CreateUnitTest.vssettings
- Go to Visual Studio 2012, select TOOLS –> Import and Export Settings.
Import and Export Settings - Select “Import selected environment settings” and click Next button.
Import and Export Settings Wizard - Then select “Yes, save my current settings” and click Next button. This step will allow you to restore back to your original setting if you made a mistake.
Save Current Settings - Then, click Browse, and look for the file you just downloaded (CreateUnitTest.vssettings) and click Open, then Next.
Select downloaded CreateUnitTest.vssettings - You may receive warnings that mentions about compromising computer. Please do not be alerted as there are no settings with the warning icon. 🙂 Click Finish then it will apply the settings. Lastly click Close to end the wizard.
[adrotate banner=”1″]
There you go, “Create Unit Tests…” menu is BACK! Do leave your comment or like my Facebook Page (not compulsory) whether the solution is working for you or not. 🙂

Solution 2: The Alternative Way
This solution was contributed by Serena Yeoh, Windows Azure MVP where the key method is to trick Visual Studio that “Create Unit Tests…” menu is not part of the removed functionality (IsPartialRemoval=”false”) by changing the order of menu in Editor Context Menu | Code Window. Check out the steps:
- Go to Visual Studio 2012, select TOOLS –> Customize…
Customize - Click Commands tab, then select Context Menu radio button, and choose Editor Context Menus | Code Window from the dropdown menu.
Customize Menu - Scroll down Controls, til you see “Create Unit Tests…” context menu. Click Move Up or Move Down button and click Close.
Move Up or Move Down - Restart Visual Studio 2012. (Close everything and start your project again)
- “Create Unit Tests…” menu is back!

Don’t you feel that your productivity in Unit Testing just increased by multifold?
Happy Unit Testing!
Yeup, I’ve got the menu item now! Darn shame it’s grayed out. 🙁
Scott,
Check out this section of the post. 🙂 It will eventually solve the problem.
http://dl.my/2013/create-unit-tests-function-not-available-or-disabled/#Solution
Dawa
solution 1 works perfect..
Thank, works fine!! 🙂
Hai am able to see Create Unit test Icon but disabled. What we need to do.
Hi Sanju,
Thank you for your post, kindly review this post on enabling the function:
http://dl.my/2013/create-unit-tests-function-not-available-or-disabled/
Solution 1 worked perfectly. Thank You.
Thanks Anthony for the confirmation 🙂
Enable “Create Unit Tests…” on Visual Studio 2012 http://t.co/kvqWcUyt
Solution 1 worked fine! (solution 2 did not work for me)
Thanks Robert. Would appreciate if you could share on how solution 2 did not work for you. Did you try restarting Visual Studio?
“Menu” works OK, however click on checkbox for project inside “Create Unit Tests” windows gives HttpException error messagebox: The given path’s format is not supported.
Any ideas?
Thank you
Hi Serg,
Perhaps it would be best if you could provide a screenshot. I am unable to re-produce the issue.
Thanks.
Dawa
i am still unable to create unit test for my .NET ASP project
I can not complete steps as the dialog box does not allow me to select the project to create tests for. Whenever I try to tick the box, I get an error message : HttpException: The given path’s format is not supported.
Screenshot: http://i.imgur.com/6WCPIzL.png?1
Thanks. The elegant solution was very helpful.
YAY!!!!!
Everything goes correctly, but at the end the CreateUnitTextCase Context menu has been disabled state. how do enable it?
Hi Ramesh,
Do read the following post: http://dl.my/2013/create-unit-tests-function-not-available-or-disabled/#Solution
This will solve the issue.
Thank you.
Dawa
Hi Dawa,
“Create Unit Tests…” workaround on Visual Studio 2012 works for C#.NET however, not for C++/CX.
I tested the workaround in a sample C#.NET Console Application project and C++/CX WindowsRuntimeComponent App project.
While “Create Unit Tests…” is enabled for C#.NET (Console Application) in Visual Studio 2012, “Create Unit Tests…” is disabled for C++/CX (WindowsRuntimeComponent App) in Visual Studio 2012.
I had posted this with screenshots in MSDN forum:
http://social.msdn.microsoft.com/Forums/en-US/vsunittest/thread/431bf28b-037c-4e62-b95c-7fc3eeabb867
Can you please help?
Thanks,
Rajani
Hi rajanipaypalajani,
I have tried and it will not work as well. If I tried creating managed test project, the Create Unit Tests… is available but it will prompt me an error saying “Test generation is unsupported for the current project type.” or “Test generation is only supported on /clr:safe C++ projects.”
I guess we are out of luck in this aside from manually creating test scripts.
Regards,
Dawa
Hi Dawa,
Interesting solution.
You can also install the online extension called “Unit Test Generator” in VS2012, which provides the same functionality.
Riccardo,
I understand that the extension was added a month ago, where this post was written way back in February. In my humble opinion, I would still prefer to use the import settings method due to the fact that it runs on zero memory footprint rather than having another extension.
Regards,
Dawa
Thanks man 🙂 it worked for me.
Solution 1 works well
Solution 1 works as advertised.
10x a lot
Glad that I could help 🙂
The Elegant version worked just fine. Tnx a lot
Solution 1 works great! Thanks 🙂
Thank you so much! This will greatly help speed up my unit testing efforts 🙂
Thanks a lot!
Great Job done by you………………..
I am not able to find CreateUnitTests option from right click on any Method,class or namespace.
I am using VS 2013.
Regarding First Solution, I did the same but not CreateUnitTests option available.
Regarding Second Solution , In command Tab not find CreateUnitTests option.
Thanks to reply or suggestion on this.
Hi,
This method only applies to Visual Studio 2012. In Visual Studio 2013, this option is no longer available.
You may want to consider using this tool: Unit Test Generator
Thank you.
Regards,
Dawa
am follow your steps for create unit test case. but unit testcase icon is disabled so what i do
am follow the above steps but disable to create unit test icon what i have to do enable..?