开发者

WOW64 - running powershell from within Visual Studio

开发者 https://www.devze.com 2023-03-16 14:14 出处:网络
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

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 some开发者_C百科thing 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号