Ajax -- Request for the permission of type 'System.Web.AspNetHostingPermission, System

Last post 05-14-2008 1:04 PM by charnata. 11 replies.

Sort Posts:

  • Ajax -- Request for the permission of type 'System.Web.AspNetHostingPermission, System

    05-31-2007, 11:54 AM

    Hai i am devolping an Web Application in asp.net 2.0 . and i had used Ajax for Implementing CollapsiblePanel.

    When i am working in my Local Machine its working fine but  when when i copy it to server machine and building the application it giving me the following error.

     Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.   


    Error 25 Could not load file or assembly 'AjaxControlToolkit, Version=1.0.10301.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418) 

     

    i have installed  ASP.NET 2.0 AJAX Extensions 1.0  in my local machine and in server as well.
     
    and downloaded ASP.NET AJAX Control Toolkit  and took the AjaxControlToolKit.dll and copied in my Bin folder of the application .and added the reference form browse option .

    If anyone faced this problem please let me know

    Thanks in Advance

    Surya
  • Re: Ajax -- Request for the permission of type 'System.Web.AspNetHostingPermission, System

    05-31-2007, 8:53 PM
    Answer
    • Loading...
    • WishStar99
    • Joined on 08-05-2006, 12:11 AM
    • VietNam
    • Posts 549

    hello,

    what you are saying is that when you hit the same page with collapsiblePanel, you get that error ... correct? if so, try hitting a different page that doesn't use AjaxControlToolkit and see if you get that error or not, if you do, try looking into your web.config file and comment out the line(s) that has "ajaxcontroltoolkit".  and hit that page again ... also the page(s) that uses ajaxcontroltoolkit ...

    hope it's the answer you are looking for ... =)

    Aeries' Coders
    Programmers' Forums at Advance Microtech


    Nothing is impossible when it comes to coding.
  • Re: Ajax -- Request for the permission of type 'System.Web.AspNetHostingPermission, System

    07-19-2007, 3:46 PM
    • Loading...
    • NitroLiq
    • Joined on 06-28-2004, 11:47 AM
    • Posts 30

    I have the same exact problem/scenario...works locally but not on the server I've moved it to. Standard .NET 2.0 pages work fine. It's only the pages with the AJAX controls that cause the error. Both .NET 2.0 and the AJAX extensions are installed on the server...this error happened before AND after the AJAX extensions were installed. Anyone have any insight what might be going on or have a solution?

     Pete
     

  • Re: Ajax -- Request for the permission of type 'System.Web.AspNetHostingPermission, System

    07-26-2007, 1:28 PM
    • Loading...
    • DirtyD
    • Joined on 05-02-2007, 6:53 PM
    • Posts 39

    I'm getting the error:

    Error 3 Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. S:\database\webforms\Insulation.aspx 86 

     in VWDEE in the error list. I can comment out the calendar extender control that causes this and I do not get any errors. I can build it no problem.

    WITH the calendarextender, the server will build the aspx file and it works great. The page looks good and all is fine. The only problem is that I cannot build it on my development machine because I get this error.

    I looked at my web.config on the server and it is set to full trust. This seems to be an issue with my local machine only. I cannot configure using my .net configuration tool since the database it tries to set up is on a server share. I set up flag 1807 which should enable setting up a .mdf database on a share. on my local machine and on the server and still no dice.

     Any other ideas?

     

    This is the error code that the .net config tool gives me when I try to edit the security settings on my dev machine:

    An error occurred during the execution of the SQL file 'InstallCommon.sql'. The SQL error number is 5110 and the SqlException message is: The file "S:\DATABASE\WEBFORMS\APP_DATA\ASPNETDB_TMP.MDF" is on a network path that is not supported for database files. CREATE DATABASE failed. Some file names listed could not be created. Check related errors. Creating the ASPNETDB_f1fc1d3a59504c49b2f8251bc4b88039 database...

     

  • Re: Ajax -- Request for the permission of type 'System.Web.AspNetHostingPermission, System

    07-26-2007, 5:20 PM
    • Loading...
    • blaze6947
    • Joined on 07-19-2007, 7:23 PM
    • Posts 9

    I was getting this same error following this video tutorial : http://www.asp.net/learn/videos/view.aspx?tabid=63&id=76

    Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    If I was to remove the confirmbuttonextender control then I wouldn't get this error at all. I was letting this solution and project be created in the default visual studio locations which really happens to be on the network here at my company because my documents is not stored on my local here. So I moved it to my local drive and corrected some path location stuff in the solution and project files using notepad and the error went away. BTW- I added Trust-full(before moving the project + solution) to  my webconfig and this did not fix the problem at all.  This is not a big deal for development but I need real solution for moving to a server because it appears to be a permissions issue and the generic aspnet account on server will probably and should probably not have the permissions this needs.

     Somebody with more knowledge please help!!!

      

  • Re: Ajax -- Request for the permission of type 'System.Web.AspNetHostingPermission, System

    07-27-2007, 3:27 PM
    • Loading...
    • NitroLiq
    • Joined on 06-28-2004, 11:47 AM
    • Posts 30

    Ugh...I got things figured out here but it was really stupid user error. Two things:

     a) The specific virtual directory was not set up as an application directory – to use AJAX it has to be.

     b) The permission error came about because I was trying to view the page from within VS and it was launching Cassini. This will work fine locally but you have to configure VS to point to the proper web server if it's hosted elsewhere. In VS:

     - Open the project.

     - Click on website menu and then Start options

     - Then Under 'server', select Use custom Server and then provide a value for base URL, something like http://localhost:<port> if using another port (Eg: http://localhost or http://localhost:80 or http://machinename:8090 etc.)

    Not sure if this will help anyone else but hopefully...

    Pete
     

  • Re: Ajax -- Request for the permission of type 'System.Web.AspNetHostingPermission, System

    08-27-2007, 12:21 PM
    • Loading...
    • mcclausky
    • Joined on 12-22-2004, 7:14 PM
    • Posts 18

    blaze6947:

    I was getting this same error following this video tutorial : http://www.asp.net/learn/videos/view.aspx?tabid=63&id=76

    Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    If I was to remove the confirmbuttonextender control then I wouldn't get this error at all. I was letting this solution and project be created in the default visual studio locations which really happens to be on the network here at my company because my documents is not stored on my local here. So I moved it to my local drive and corrected some path location stuff in the solution and project files using notepad and the error went away. BTW- I added Trust-full(before moving the project + solution) to  my webconfig and this did not fix the problem at all.  This is not a big deal for development but I need real solution for moving to a server because it appears to be a permissions issue and the generic aspnet account on server will probably and should probably not have the permissions this needs.

     Somebody with more knowledge please help!!!

      

    Blaze,

    I have exactly the same error. My Site is located on a network mapping drive.  The solution .sln file is located in my local disk drive.  Could you please tell us which files did you edit with notepad and what path locations did you modify?

    Thanks

    Mc

     

  • Re: Ajax -- Request for the permission of type 'System.Web.AspNetHostingPermission, System

    08-27-2007, 1:08 PM
    • Loading...
    • blaze6947
    • Joined on 07-19-2007, 7:23 PM
    • Posts 9

    I believe I modified the .sln file after moving everything to my local drive and creating a virtual directory in IIS to point to this new location.

    There are some path properties for where the solution expects the project files to be located in there, it is pretty easy to figure out.

  • Re: Ajax -- Request for the permission of type 'System.Web.AspNetHostingPermission, System

    09-04-2007, 11:29 AM
    • Loading...
    • Pepepe
    • Joined on 09-04-2007, 3:28 PM
    • Posts 1

    The Solution:

    To resolve this issue, you must change your development machine .net security configuration since you are accessing items across the network. In the event that you need this ability at runtime, you must change the trust level in your config file to full. However, since this is only in development, I can change my local PC's security by going to Start > Control Panel > Administrative Tools > Microsoft .NET Framework 2.0 Configuration. After it fully loads (sometimes takes a bit), fully expand My Computer in the navigation tree and click Runtime Security Policy. In the right hand pane, choose Adjust Zone Security. Leave the default option (Make changes to this computer) and hit next. Choose Local Intranet and change the trust level to Full Trust. Then choose next and then finish. Restart Visual Studio 2005 and you should be all set. 

    I red it here: http://dotnetslackers.com/Security/re-50692_System_Web_AspNetHostingPermission_when_Accessing_Network_or_Intranet_Projects_using_Visual_Studio_2005.aspx

     

  • Re: Ajax -- Request for the permission of type 'System.Web.AspNetHostingPermission, System

    09-06-2007, 8:23 PM
    • Loading...
    • mcclausky
    • Joined on 12-22-2004, 7:14 PM
    • Posts 18

    Pepepe:

    The Solution:

    To resolve this issue, you must change your development machine .net security configuration since you are accessing items across the network. In the event that you need this ability at runtime, you must change the trust level in your config file to full. However, since this is only in development, I can change my local PC's security by going to Start > Control Panel > Administrative Tools > Microsoft .NET Framework 2.0 Configuration. After it fully loads (sometimes takes a bit), fully expand My Computer in the navigation tree and click Runtime Security Policy. In the right hand pane, choose Adjust Zone Security. Leave the default option (Make changes to this computer) and hit next. Choose Local Intranet and change the trust level to Full Trust. Then choose next and then finish. Restart Visual Studio 2005 and you should be all set. 

    I red it here: http://dotnetslackers.com/Security/re-50692_System_Web_AspNetHostingPermission_when_Accessing_Network_or_Intranet_Projects_using_Visual_Studio_2005.aspx

     

     

    Pepepe:

    Thanks a lot!!  That's the ONLY solution that worked.

    regards.

     

     

     

     

  • Re: Ajax -- Request for the permission of type 'System.Web.AspNetHostingPermission, System

    12-26-2007, 12:24 PM
    • Loading...
    • mholmes1
    • Joined on 12-26-2007, 5:23 PM
    • Posts 1

    yup

    Worked for me too.

     

    Thanks!

  • Re: Ajax -- Request for the permission of type 'System.Web.AspNetHostingPermission, System

    05-14-2008, 1:04 PM
    • Loading...
    • charnata
    • Joined on 05-12-2008, 2:18 PM
    • Posts 1

    FYI, my issue was that I could not load the AjaxControlToolkit.dll.   I got the same error and found this forum.  I had to also give "Full Trust" to the assembly before it would work.

Page 1 of 1 (12 items)