Mitchel's Forums

Subject: Accessing & modifying web.config from modules
Prev Next
You are not authorized to post a reply.

AuthorMessages
r_honeyUser is Offline
Regular User
Regular User
Posts:73

07/07/2008 10:06 PM  

 

I am develoing custom modules for DotNetNuke. Some of my modules need to access or modify configuration information in web.config. However, when I try to perform any of these operations, I get Excetion on following lines:

 System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. (machine.config) ---> System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at System.Configuration.Internal.InternalConfigHost.StaticOpenStreamForRead(String streamName) at System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName, Boolean assertPermissions) at

 However, DNN itself accesses & modifies web.config at various points. That means there must be a safe mechanism of doing so. How can I do that without causing exceptions to be raised???

Mitchel SellersUser is Offline
Site Admin/Owner
Guru
Guru
Posts:5607

07/08/2008 8:56 AM  
That issue is related to security permissions for the DNN root directory, I would triple check that you didn't in some manner loose the default permissions.

-Mitchel Sellers
MCITP, MCPD, MCTS
Director of Development
IowaComputerGurus Inc.

View Mitchel Sellers's profile on LinkedIn

3Essentials is my recommended Shared Hosting Provider

This site is hosted on a VPS from HostMySIte.com

Mosso is my recommended cloud computing provider. Use reference code REF-ICG to get $100 off your second month!

To get Guaranteed DNN Support check out our affordable DNN Technical Support Programs
You are not authorized to post a reply.
Forums >Development Discussion >DotNetNuke > Accessing & modifying web.config from modules



ActiveForums 3.7