title: Visual Studio 2010 - Debug DLL - Debug Command using rundll32 doesn't work
body: <p>I have a problem debugging a C++ DLL project in Visual Studio 2010. While debuging I want the DLL to be loaded by rundll32.exe automatically. To do so I follow these steps (like here <a href="http://msdn.microsoft.com/en-us/library/c91k1xcf.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/c91k1xcf.aspx</a>):</p>
  
  <ol>
  <li><p>In Solution Explorer, I select the project that creates the DLL.</p></li>
  <li><p>From the View menu, I choose Property Pages.</p></li>
  <li><p>In the Property Pages dialog box, I open the Configuration Properties folder and select the Debugging category.</p></li>
  <li><p>In the Command box, I type: "C:\Windows\System32\rundll32.exe"</p></li>
  <li><p>In the Command Arguments box I type (main is the function to be executed): output.dll, main</p></li>
  <li><p>In the Working Directory I type: $(SolutionDir)$(Configuration)</p></li>
  <li><p>Attach -> yes</p></li>
  </ol>
  
  <p>After following these steps, I try to debug the DLL, but I get this error: </p>
  
  <p><em>"Unable to attach. Process "C:/Windows/System32\rundll32.exe" is not running on "MY-PC", Refresh the process list before attempting another attach."</em></p>
  
  <p>Anyone know how to debug a DLL, without manually starting rundll32.exe from command prompt and manually attaching to this process?</p>