0

I've got a security exception when I try to create filestream

FileStream f = new FileStream(filename, FileMode.Create); 

Even when I set filename as D:\filename.xml(even not on disc C:).

How to resolve this problem?

2 Answers 2

1

Probably Silverlight application hasn't access to disk D for writing. Typically SL application runs in partial trust. You can try to use required elevated trust.

There is similar question - Silverlight 4.0 FileStream

Sign up to request clarification or add additional context in comments.

Comments

1

If you're building an Out-of-browser Silverlight application, go to your Project Properties and check "Enable running application out of browser".

Inside "Out-of-browser settings" check "Require elevated trust when running outside the browser".

Also, make sure the user running the application has permission to create/write to the destination path.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.