开发者

When assembly is inside 'C:\Windows\System32' i get 'Unable to find a version of the runtime to run this application'

开发者 https://www.devze.com 2023-03-02 14:24 出处:网络
I\'m currently writing a screensaver using C# and the express version of VS2010. I\'ve created a nice little screensaver and renamed the resulting assembly to have a *.scr extension.

I'm currently writing a screensaver using C# and the express version of VS2010. I've created a nice little screensaver and renamed the resulting assembly to have a *.scr extension.

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. However, when i install this by placing it into the C:\Windows\System32 folder, i try double clicking on it and get this error:

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.

Any idea what开发者_运维技巧 is going on?


The problem is that the screensaver was compiled for 32bit cpu. Only 64bit exes are allowed in the %WINDIR%\System32 folder on a 64bit OS. Which in fact, i was using Windows7 64bit.

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.

0

精彩评论

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