Quantcast
Channel: General
Viewing all articles
Browse latest Browse all 7363

Setting Custom Trust level with changed FileI/O Permission

$
0
0

We have a portal with a series of web apps which is being transferred to IIS 7.0.  The apps on this portal refer to a configuration file on another branch of the file tree to get information that they all need.  So under wwwroot there exist one directory with the portal and the apps and another directory called appNameconfig, with a config file in this directory.

This works fine as long as trust level is set to High with

<IPermission
                                    class="FileIOPermission"
                                    version="1"
                                    Unrestricted="true"
                            />

However it breaks because it cannot see the config file when trust level is set to medium with

<IPermission
                                    class="FileIOPermission"
                                    version="1"
                                    Read="$AppDir$"
                                    Write="$AppDir$"
                                    Append="$AppDir$"
                                    PathDiscovery="$AppDir$"
                            />

So we designed a custom trust level file whose only difference between it and medium is:

<IPermission
                                    class="FileIOPermission"
                                    version="1"
                                    Read="C:\inetpub\wwwroot\appNameConfig;$AppDir$"
                                    Write="$AppDir$"
                                    Append="$AppDir$"
                                    PathDiscovery="$AppDir$"
                            />

However, the app still is throwing the error that says it cannot see the config file.  We made this change as recommended byhttp://msdn.microsoft.com/en-us/library/ff648344.aspx  How To: Use Medium Trust in ASP.NET 2.0\OleDbPermission, EventLogPermission and FileIOPermission\FileIOPermission

Is there something we are missing that also needs to be changed?

 

 


Viewing all articles
Browse latest Browse all 7363

Trending Articles



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