954,560 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

HELP PLEASE: System.Security.SecurityException

First off I would like to say that I am new to asp.net and programming in general. I have created a website that is being hosted at Network Solutions on a Windows server. My html and aspx pages load fine. On my aspx pages I am using the asp login control and the create user wizard control which is using a SQL Server back end to store the data. On the hosted aspx pages when I click on the button to login or create a new account I get the following error:

Security Exception
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's 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.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessPermission.Demand() +58
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) +644
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +66
System.Configuration.Internal.InternalConfigHost.StaticOpenStreamForRead(String streamName) +85
System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName, Boolean assertPermissions) +124
System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName) +10
System.Configuration.Internal.DelegatingConfigHost.OpenStreamForRead(String streamName) +13
System.Configuration.UpdateConfigHost.OpenStreamForRead(String streamName) +46
System.Configuration.BaseConfigurationRecord.InitConfigFromFile() +293


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082

This does work locally on my dev machine. Network Solutions is absolutely no help with this at all.

Please help. I have been batteling this for a week and have missed my deadline. Any suggestions on fixing this issue would be great.

Thanks.

ochness
Newbie Poster
2 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

Add this code in web config file ...
string>

may be solve your problem.....

Mind Bird
Newbie Poster
11 posts since Dec 2009
Reputation Points: 10
Solved Threads: 3
 

Thank you very much for your reply. I have all of the code you suggested in my web.config file already. Even with that in the file I still get the error. Someone in another forum suggested using the following but I don't know where that code needs to go:

change following :
_

to :
_

Any other suggestions would be great....thanks.

Add this code in web config file ... string>

may be solve your problem.....

ochness
Newbie Poster
2 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You