Note that there are some explanatory texts on larger screens.

plurals
  1. PO.Net Screensaver does not find config file
    primarykey
    data
    text
    <p>I've written a screen saver in C# and Windows Forms. For testing I've been lazy and just used the config file for all my settings (no settings dialog yet), but the program seems to be unable to find or read the config file when windows runs the screensaver.</p> <p>It works when I use the preview button or run it manually in any way, its only when it hits the screensaver timeout that it is unable to find the config file.</p> <p>Having it log <code>AppDomain.CurrentDomain.SetupInformation.ConfigurationFile</code> It returns the short name: <code>C:\Windows\System32\MYSCRE~1.config</code> Where it should be <code>C:\Windows\System32\MyScreenSaverName.scr.Config</code></p> <p>So I'm guessing the problem is that it can't find the config file with the short name path.</p> <p>Not sure if its due to the system account which Windows 7 runs screen savers under, or something else about how it gets run. Any information would be helpful, thanks.</p> <p><strong>Edit:</strong> Trying to find any differences:</p> <ol> <li>Only difference I can find is that <code>Environment.CommandLine</code> returns <code>C:\Windows\system32\MYSCRE~1.SCR /s</code> when Windows runs the screen saver, but has the normal path when I run it</li> <li>Everything under <code>Process.GetCurrentProcess().StartInfo</code> is the same</li> <li><code>WindowsIdentity.GetCurrent().Name</code> is my account name</li> </ol> <p>Looking at other questions, it seems that User32 is what starts the screensavers, so I'm figuring it has to be something about how that starts up the scr process.</p> <p><strong>Work Around:</strong> Renaming my .scr file to have 8 characters or less allows it to work correctly. So that works for now, would still love to know why this problem exists.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload