Error : MFC requires use of Winsock2.h after migrating Visual C++ project to Visual Studio 2013
<p>After migrating a project from Visual C++ to Visual Studio 2013 I receive the following error on building the project: </p>

<p><code>C1189:#error: MFC requires use of Winsock2.h</code></p>

<p>In <code>stdafx.h</code> I've included the following headers: </p>

<pre><code>#include &lt;afxwin.h&gt; 
#include &lt;afxext.h&gt;
#include &lt;afxdtctl.h&gt;
#include &lt;afxcmn.h&gt;
#include &lt;afxsock.h&gt;
#include &lt;WinSock2.h&gt;
</code></pre>

<p>I've tried to change the order of the include files ( winsock before and after MFC headers ) but still the same errors. </p>

<p>Can anyone give me some ideas to solve this issues ? Thank you !</p>