MATLAB: Do I receive an error with MEX SETUP even after installing Microsoft SDK 7.1 with .NET framework

206)errorlineMATLABmexmicrosoftsdkusing

I installed Microsoft SDK 7.1 with .NET framework on my machine by doing the steps given in the following solution page.
I also have installed Microsoft Visual C++ 2010 Redistributables prior to the installation of Windows SDK 7.1.  
When I execute the below command:
mex -setup
In MATLAB 2014a and later version, after I click the link of Windows SDK 7.1, the error below appears:
ERROR: error using mex (line 206)
In MATLAB 2013b and earlier vesions, the error shows as below: 
ERROR: >> mex -setup\n\nWelcome to mex -setup. This utility will help you set up \na default compiler. For a list of supported compilers, see \nhttp://www.mathworks.com/support/compilers/R2013a/win64.html \n\nPlease choose your compiler for building MEX-files: \n\nWould you like mex to locate installed compilers [y]/n? y\n\nSelect a compiler: \n[1] Microsoft Software Development Kit (SDK) 7.1 in C:\Program Files (x86)\Microsoft Visual Studio 10.0 \n\n[0] None \n\nCompiler: 1\n\nPlease verify your choices: \n\nCompiler: Microsoft Software Development Kit (SDK) 7.1 \nLocation: C:\Program Files (x86)\Microsoft Visual Studio 10.0 \n\nAre these correct [y]/n? y***************************************************************************** \n Error: The Microsoft Windows Software Development Kit (SDK) installation is \n incomplete. Please be sure that the .NET Framework is installed \n correctly before attempting to reinstall the SDK. \n***************************************************************************** \n\nError using mex (line 206)\nUnable to complete successfully.

Best Answer

This issue occurs when the Microsoft SDK installation has not gone properly.

This issue occurs when you install the Windows 7 SDK on a computer that has a newer version of the Visual C++ 2010 Redistributable installed. The Windows 7 SDK installs version 10.0.30319 of the Visual C++ 2010 Redistributable.
To resolve this issue, you must uninstall all versions of the Visual C++ 2010 Redistributable before installing the Windows 7 SDK.
You may have one or more of the following products installed:
Microsoft Visual C++ 2010 x86 Redistributable
Microsoft Visual C++ 2010 x64 Redistributable
After uninstalling the Microsoft Visual C++ 2010 Redistributable products, you may install the Windows 7 SDK.
IMPORTANT: Please make sure ‘Visual C++ Compilers’ under ‘Windows Native Code
Development’ is UNCHECKED at the Installation Option view.
Install Visual C++ Compilers using the following Microsoft patch:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=4422
Once Microsoft Windows SDK 7.1 SDK is successfully installed and no "Installation Failed" message is received, execute the following command from MATLAB Command Window to select the Windows SDK 7.1 compiler:
>> mex -setup
Related Question