EDITBIN gives LNK1104 (cannot open file)

2019-06-08 03:32发布

问题:

I am trying to increase stack size of 32 bit IIS by using following command

EDITBIN /STACK:1048576 w3wp.exe

but facing following issue:

fatal error LNK1104: cannot open file w3wp.exe

I checked w3wp.exe is present in windows/system32/inetsrv folder.

回答1:

Understanding that you addressed your issue (presumably a Stack Overflow Exception) with the explicitly-create-threads workaround, here's the actual answer to your question:

The error provided ("cannot open file w3wp.exe") is, as described, a file access error or some sort. The documentation (http://msdn.microsoft.com/en-us/library/ts7eyw4s.aspx) lists all sorts of possible causes for this error, but you are likely encountering one of three issues:

  • Maybe the file is in use because the process is running (make sure you stop all instances of w3wp.exe running on your system, regardless of who started the process - eg by stopping all application pools manually).
  • Maybe you do not have permissions to edit the file because you did not start the VS command prompt "As Administrator".
  • Maybe you do not have permissions to edit the file because it is owned by "TrustedInstaller", and even the "Administrators" group does not have write access. If this is the case, then to modify the file you would need to change the owner (eg http://helpdeskgeek.com/windows-7/windows-7-how-to-delete-files-protected-by-trustedinstaller/)

I had to deal with all three of these issues to be able to actually change the default max stack size in IIS on Windows 7.

But as you noted, the explicit thread creation will usually be a better idea if you CAN do this, as it will avoid the server-maintenance overhead of manually patching the w3wp.exe file every time a windows update modifies it.



回答2:

I solved the issue by creating a new Thread with reference of following link.

http://blogs.msdn.com/b/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx



回答3:

I was trying to update my Visual Studio to be LARGEADDRESSAWARE. As per http://mkwec.de/2010/01/08/make-visual-studio-use-more-than-2-gig-of-memory/

It turns out I needed to simply launch Developer Command Prompt for Visual Studio "As Administrator" as suggested by Tao