Search code examples
c#.netscreensaver

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. 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?


Solution

  • 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.