locked
can't login from my website in godaddy share hosting (asp.net 3.5) RRS feed

  • Question

  • User-635215137 posted

    Hi:

    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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    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.

    JT


    Tuesday, December 1, 2009 1:15 PM

Answers

  • User-1028151323 posted

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 3, 2009 6:13 AM
  • User1774691446 posted

    Instead, you can change trust level of your application to medium in web config file.

    See MSDN article re: trust levels.

    http://msdn.microsoft.com/en-us/library/tkscy493.aspx 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 3, 2009 6:19 AM
  • User176332441 posted

    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. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 3, 2009 8:21 AM
  • User-635215137 posted

    Hi: Darth

    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...)

    Regards.

    JT

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, December 4, 2009 3:09 PM

All replies

  • User-1028151323 posted

    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?


    Wednesday, December 2, 2009 11:24 AM
  • User-635215137 posted

    Hi: Darth

    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:

    "If you are using ASP.NET 1.1 on your Windows Hosting account, you have "full trust" on the server. If you are using using .NET runtime environment 2.0 or higher, then you have "medium trust" on the server. If you need to use ASP.NET 2.0 or higher with full trust, then you may consider a Dedicated Hosting Server."

    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.

    JT

    Thursday, December 3, 2009 2:27 AM
  • User-1028151323 posted

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 3, 2009 6:13 AM
  • User1774691446 posted

    Instead, you can change trust level of your application to medium in web config file.

    See MSDN article re: trust levels.

    http://msdn.microsoft.com/en-us/library/tkscy493.aspx 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 3, 2009 6:19 AM
  • User176332441 posted

    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. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 3, 2009 8:21 AM
  • User-635215137 posted

    Hi:

    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:

    I understand you have a question about a security error that you see when running a login control in your hosting plan. Our shared hosting plans operate at Medium Trust.
    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.

    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. Thank you.

    JT

    Thursday, December 3, 2009 1:24 PM
  • User-1028151323 posted

    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.

    Thursday, December 3, 2009 2:19 PM
  • User-635215137 posted

    Hi: Darth

    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.

    Thanks Darth.

    JT

    Friday, December 4, 2009 12:35 AM
  • User-635215137 posted

    Hi: Darth

    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...)

    Regards.

    JT

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, December 4, 2009 3:09 PM
  • User1688067758 posted

    Thanks, been working on this for weeks.

    "Medium Level" "Full" Level stuff - Did The Job for me . !!!!

     

     

     

    Saturday, January 18, 2014 5:38 AM