MATLAB: Do I receive an error with XPCEXPLR in xPC Target 5.0 (R2011a)

Simulink Real-Time

When I launched XPCEXPLR in MATLAB command window, MATLAB returned the following error:
 
??? Error using ==> xpcexplr at 26
Message: Unable to load one or more of the requested types. Retrieve the
LoaderExceptions property for more information.
Source: mscorlib
HelpLink:
The xPC Target Explorer window was opened but I could not select any option. I received the following error when I tried to select something in xPC Target Explorer:
  ERROR: ??? Error using ==> find Second argument must be a positive scalar integer. Error in ==> C:\Program Files\MATLAB\R2011a\toolbox\rtw\targets\xpc\xpc\@xpcExplorer\@explrGUI\createjsplitter.p>i_splitterjava at 49
??? No appropriate method, property, or field xPCexplrObj for class
hg.figure.
Error in ==> C:\Program
Files\MATLAB\R2011a\toolbox\rtw\targets\xpc\xpc\@xpcExplorer\@explrGUI\createMenus.p>i_menuClick1
at 144
??? Error while evaluating uimenu Callback
A similar error message occurs when trying to run XPCEXPLR: ERROR: Error using targets.targets (line 36) Message: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. Source: mscorlib HelpLink: Error in C:\Program Files\MATLAB\R2012a\toolbox\rtw\targets\xpc\xpc\+desktop\xpcdesktop.p>xpcdesktop.getInstance (line 12) tgs = xpctarget.targets; Error in xpcexplr (line 14) desktop.xpcdesktop.getInstance;

Best Answer

This error occurs because of a corrupt installation of the .NET Framework.
A .NET Framework 3.5 or higher is required for xPC Target to work properly. v3.5 should be installed by default on Windows 7 machines.
You can fix this issue by reinstalling the same from Microsoft's website:
The xPC Target Explorer R2012a and above, requires the version 4.0 of the .NET framework.
You can find it either here:
Or in the MATLAB installation path:
MATLABROOT/toolbox/rtw/targets/xpc/xpc/bin/dotnetfx
with the name: dotNetFx40_Full_x86_x64.exe