I want to store some confidential values (such as database connection strings, some passwords) in a Setting.cs (and there in a static class) file.
Is it 100% sure, that IIS 7 is not serving this file in plain text?
Or are there any known vulnerabilities?
Neither one is safe.
When your source files are compiled, all strings can be easily accessed via tools like reflector or ildasm.
Config files are plain text, so any text editor can view such data.
Best practice is to encrypt the sensitive configuration sections.