Hello everybody. I am trying to solve a problem, which, apparently, is not uncommon, and I'm not sure how to find how it was solved for people. When I run StructureMap on my machine through IIS, I get an exception and looks like this:
**Description**: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application trust level in the configuration file.
**Exception Details**: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
This question arose in SO ( https://stackoverflow.com/questions/784666/ ), in the comments on this blog post and a year ago on the structuremap mailing list .
My problem is not running in a foreign hosting environment. I can’t even start it in my window (IIS 7.5, Win7 RC, .NET 3.5). I tried to configure the site to use a custom policy file, and FileIOPermission is marked as unlimited access ... without cubes. If anyone has a few tips or links, we will be very grateful.
Update
Thus, there is no way that this would be the best way to solve the problem, but after digging around and studying what Joshua said, this is what I needed to do to get it working: StructureMap, access security code and a bad solution to the problem . A better solution would be appreciated.
source
share