Last post Jan 18, 2014 05:38 AM by refson
Dec 01, 2009 01:15 PM|jamest85|LINK
I am having an issue on my website (asp.net 2.0, C#) when I try to login: http://datawebcoder.com/login.aspx
The error is:
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=188.8.131.52, Culture=neutral,
Here is the answer from godaddy support:
Upon review, it appears that this issue is due to the trust level required by your application. Our hosting plans using ASP.NET 3.5 is a medium trust environment. Trust level refers to permissions set in the Web.config file that dictate what operations
can and cannot be performed by Web applications. Our ASP.NET 3.5 shared hosting servers use the default Medium trust level with the addition of OleDbPermission, OdbcPermission, and a less-restrictive WebPermission.
Applications operating under a Medium trust level have no registry access, no access to the Windows event log, and cannot use ReflectionPermission (but can use Reflection). Such applications can communicate only with a defined range of network addresses and
file system access is limited to the application's virtual directory hierarchy.
Using a Medium trust level prevents applications from accessing shared system resources and eliminates the potential for application interference. Adding OleDbPermission and OdbcPermission allows applications to use those data providers to access databases.
WebPermission is modified to allow outbound http and https traffic.
And I asked them how to fix it, godaddy just gives me below answer:
Our shared hosting server that are running asp.net 2.0 and higher are set to run scripts in medium trust levels. Unforently this how we have are server currently setup.
Do you guys have any suggestion on how to fix the problem? Have searched online, but I haven't got any clue yet?
Thank you very much.
Dec 02, 2009 11:24 AM|DarthSwian|LINK
Its not a trust issue. My apps run on godaddy and I use the ASP.Net membership for all of them. Are you sure the application name is correct in the DB and your web.config?
Dec 03, 2009 02:27 AM|jamest85|LINK
Thank you very much for your suggestion.
I got 2nd email from godaddy, and telling me to upgrade to dedicated server which I am not going to do it:
Since the problem is from Login.aspx page, so I create a LoginTest.aspx page which only has a single Login Control without adding any extra code, the error is also raised: http://datawebcoder.com/LoginTest.aspx
So that means the current Window share server I am using from godaddy.com can't even run a simple login aspx page, I wish the problem is on my side, but I am not exactly sure, and I am going to write an email to godaddy, see if they can use Visual Studio
2005, create a Default.aspx page which only has a Login control in it, and see if they will get the same error I am having now.
Dec 03, 2009 06:13 AM|DarthSwian|LINK
Good luck, godaddy WON'T do anything to support code. They're great for issues with DNS and FTP, but they won't do anything to assist you with your code problems. Trust me, been there.
Dec 03, 2009 06:19 AM|prajeeshkkindia|LINK
Instead, you can change trust level of your application to medium in web config file.
See MSDN article re: trust levels.
Dec 03, 2009 08:21 AM|tamilcodes|LINK
You just have to modify the code to work in godaddy in medium trust... Or just change the relevant sections in your code which involves file modification operations. Even ifyou use mysql .net connector 1.0 you may encounter the same problem.
Or look for some good hosting provider who gives full trust to your application.
Dec 03, 2009 01:24 PM|jamest85|LINK
Thanks all for your information.
I am thinking to shift to other asp.net hosting companies.
Godaddy sents me another email after I questioned about adding a single login control in a testing aspx page:
Not sure what to do know, and I am not going to ask godaddy again because I don't think it will go any further to solve the problem. I will try to modify my .config file and see if I have any luck, but I doubt. If you have any suggestion will be really appreciated.
Dec 03, 2009 02:19 PM|DarthSwian|LINK
I hate to say it but I think it must be something in your app. I host and maintain several sites on GoDaddy. All use asp.net membership and login controls and I have no issues with security permissions.
Dec 04, 2009 12:35 AM|jamest85|LINK
I will be happy if my app has something to do with it otherwise I need to find another hosting company.
I am going to remove all current files in the server and replace a sigle default.aspx page which only has a "login" control in it.
See how goes.
Dec 04, 2009 03:09 PM|jamest85|LINK
As I mentioned in last post, I am going to remove all current files from server, and create a simple default.aspx page which only has a login control in it.
That simple app is working, no more error, that means the server is accept the "login" control, then I upload each folder one by one to see if they cause any error, and then upload files one by one.
The result is: it works fine now!
I don't know why, I didn't change any thing during the processing, so I think during the re-uploading the files to the server, the server re-complie my application?.... (Just guess)
Anyway, thank you very much for your help, it helps me see the things out of the box (which is "Medium Level" "Full" Level stuff...)
Jan 18, 2014 05:38 AM|refson|LINK
Thanks, been working on this for weeks.
"Medium Level" "Full" Level stuff - Did The Job for me . !!!!