System.Web.AspNetHostingPermission when using VS 2K5 & no problems when accessing the url???

Last post 02-01-2007 4:35 PM by darkenednet. 1 replies.

Sort Posts:

  • System.Web.AspNetHostingPermission when using VS 2K5 & no problems when accessing the url???

    01-02-2007, 11:17 AM
    • Member
      180 point Member
    • avarair
    • Member since 04-21-2006, 7:22 PM
    • Posts 52

    I am using VS 2k5 and accessing the site I created for test on our local intranet (something like http://test.xyz.com/media_locdef.aspx?pub=CE&promocode=DG8420).  I have a CreditCardValidator.dll in the bin folder of the app, which I brought in from the app we have in version 1.1.  All worked fine on my when I used Asp .Net Development Server, and I could debug my app/pages.  Now it works under IIS with no problems, if I just access the app over HTTP.  I am trying to debug my app in VS2k5 and it gives this error:

    Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. \\Web1\e$\websites\avarair\test\Controls\person.ascx 87 ,

    the line where the custom control is referenced in my pages, something like this:

    <

    etier:CardTypesListBox id="CardTypesListBox1" runat="server" Height="20px" Rows="1">.

    I am assuming this could be an issue related to control build providers, because it underlines the line of code, when I have the web site page open in VS.

    I don't know how could I not be granted a "Build Permission" - can't guess anything here, but is there a way to enable me/my credentials to have build permission in IIS or .Net config tools.

    thanks for your time,

    Avarair

  • Re: System.Web.AspNetHostingPermission when using VS 2K5 & no problems when accessing the url???

    02-01-2007, 4:35 PM
    • Member
      14 point Member
    • darkenednet
    • Member since 02-01-2007, 4:27 PM
    • Posts 2

    I had this exact same problem and it plagued me for some time. Here's how I managed to fix it:

    Launch the .NET Framework 2.0 Configuration (Start...Control Panel...Administrative Tools)

    Expand "My Computer"

    Click on "Runtime Security Policy"

    On the right a list of Tasks should appear.

    Choose "Adjust Zone Security".

    Choose "Make changes to this computer"

    Click "Next"

    Choose "Local Intranet" (or whichever is appropriate, for me the server is on my local network)

    Move the slider up to "Full trust"

    Click "Next"

    Click "Finished"

    Restart Visual Studio

    Try rebuilding and it should now work!

Page 1 of 1 (2 items)