2

When I run the code below, my console app outputs:

"Unhandled Exception: System.IO.IOException: The Request is not supported."

static void Main()
{
    var xmlFile = "Encrypt.xml";

    File.Encrypt(xmlFile);
}

I'm running Windows 7 Home Premium, coding with Visual Studio 2010, and coding in C#.
Could someone tell me what's wrong?

James Litewski
  • 451
  • 2
  • 6
  • 16

1 Answers1

4

This InformIT article seems to indicate that it's only supported on the Professional and above editions.

In Summary:

EFS is included in Windows XP Professional; Windows Vista Business, Enterprise, and Ultimate; and the Professional, Enterprise, and Ultimate editions of Windows 7.

Anya Shenanigans
  • 91,618
  • 3
  • 107
  • 122
  • Well, that really is lame.. Is there any reason for this? – James Litewski Mar 26 '11 at 10:55
  • I would presume it would be because they believe encryption was an option targeted at businesses. Plus, I don't think people remember to back up their encryption certificates causing them to lose the data when they need to reinstall – Anya Shenanigans Mar 26 '11 at 11:08
  • You don't get bitlocker either, and until you get the Enterprise/Ultimate edition bitlocker can't be used for removable media. All the separate versions of windows make things really confusing for customers. – Anya Shenanigans Mar 26 '11 at 11:10
  • Dang.. Encrypting sounded interesting too, since I'm a new programmer.. Anyway, thanks for clarifying. – James Litewski Mar 26 '11 at 11:17