Quantcast
Viewing all articles
Browse latest Browse all 18858

FileIOPermission for Partial Trust to read files in BaseDirectory

For practice, I'm writing a partial trust WPF C# application using VS 2010. The program involves some sound, so I've provided some .wav files in the program's base directory.

To avoid problems at runtime, in the app.config file I have used:

<IPermissionclass="System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"version="1"Read="*AllLocalFiles*"/>

Q: How can I provide read access to files only in the 'base directory'? Since the base directory is not known until the program is deployed, this seems to pose a problem. It seems I need to provide absolute paths for files and directories, according to the FileIOPermission documentation.

Thanks for your help!


philb222


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>