WOW64 - running powershell from within Visual Studio

扶醉桌前 提交于 2020-01-05 03:47:06

问题


Can someone please explain, simply, why it is necessary to go through so many hoops in order to run PowerShell (as an external command) from visual studio? I know it has to do with the bit differences but don't get why. The context is a 64 bit Windows 7 OS, 32 bit Visual Studio, and 32 bit powershell from the System32 folder if I remember correctly. A 64 bit OS can run both 32/64 applications without problems, so what is the issue here, and why?

By internet searching I believe this has something to do with WOW64, hence the tag, but I'm not really sure. I know the OS emulates the old 32 bit software but I don't see why VS can't run the command to start powershell without going through hoops, such as adding a '...Native...' folder (that acc. to our instructor doesn't actually exist) to the path.

Hope that isn't confusing.


回答1:


Visual Studio is a 32-bit process, there is no 64-bit version. When you ask it to run something from c:\windows\system32, Windows will redirect the request to c:\windows\syswow64. The home of all 32-bit Windows executables.

Using %windir%\sysnative instead is the workaround, that gets redirected to c:\windows\system32.

The file system redirector is described here.



来源:https://stackoverflow.com/questions/6514416/wow64-running-powershell-from-within-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!