[英]When assembly is inside 'C:\Windows\System32' i get 'Unable to find a version of the runtime to run this application'
I'm currently writing a screensaver using C# and the express version of VS2010.我目前正在使用 C# 和 VS2010 的 express 版本编写屏幕保护程序。 I've created a nice little screensaver and renamed the resulting assembly to have a *.scr extension.
我创建了一个漂亮的小屏幕保护程序,并将生成的程序集重命名为具有 *.scr 扩展名。
When i place this on my desktop and double click it (or select configure from the context menu), it runs fine and displays the correct form/screensaver.当我将它放在我的桌面上并双击它(或从上下文菜单中配置 select)时,它运行良好并显示正确的表单/屏幕保护程序。 However, when i install this by placing it into the
C:\Windows\System32
folder, i try double clicking on it and get this error:但是,当我通过将其放入
C:\Windows\System32
文件夹来安装它时,我尝试双击它并收到此错误:
Unable to find a version of the runtime to run this application
Also it doesn't work from the screensaver control panel.它也不能从屏幕保护程序控制面板工作。 It's listed in the drop-down but it doesn't function.
它列在下拉列表中,但没有 function。
Any idea what is going on?知道发生了什么吗?
The problem is that the screensaver was compiled for 32bit cpu.问题是屏幕保护程序是为 32 位 cpu 编译的。 Only 64bit exes are allowed in the
%WINDIR%\System32
folder on a 64bit OS.在 64 位操作系统上的
%WINDIR%\System32
文件夹中只允许 64 位 exe。 Which in fact, i was using Windows7 64bit.事实上,我使用的是 Windows7 64 位。
The correct place to put 32bit screensavers is in %WINDIR%\SysWOW64
or compile using 'AnyCPU' option in Visual Studio then you can install into the %WINDIR%\System32
for all.放置 32 位屏幕保护程序的正确位置是
%WINDIR%\SysWOW64
或使用 Visual Studio 中的“AnyCPU”选项编译,然后您可以安装到%WINDIR%\System32
中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.