Same File operation not permitted. Access to path denied, Silverlight 5.0

1k Views Asked by At

I am working with a silverlight application, File.WriteAllText is giving File operation not permitted when trying to write to local desktop. Access to path exception. This code always works on local desktop but, is giving error when code is deployed on server.

1

There are 1 best solutions below

1
itzmebibin On

Silverlight does not have the access priveleges like u expect. If you want to add a file to your Silverlight Application at runtime, you will need to have Silverlight running Out of the Browser with Elevated priveleges. There are certain limitations to this too. You can only access files in Special Folders like My Documents, Pictures, Music etc. For more info, see this and this