Security Exception when creating object

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Security Exception when creating object

    Hi,

    I am deploying my web application to a new host site and am having
    problems setting up the email. The site does not support ASP.NET
    user.

    There is an .asp file that works correctly with the following code:

    set smtp = Server.CreateObject("Bamboo.SMTP")

    I am trying to migrate this to the vb code behind (aspx). Since the
    set statement is not supported, I tried the following code

    Dim smtp as object
    smtp = Server.CreateObject("Bamboo.SMTP")

    This caused a security exception (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.)

    I modified the web.config with:

    <trust level="Medium" />

    but the site administrator has locked access to this section using
    <location allowOverride="false"> from an inherited configuration file.
    I also tried <identity impersonate="true"/> with same results.

    I then tried
    Dim smtpType = Type.GetTypeFromProgID("Bamboo.SMTP")

    but this gets a security exception too.

    I have considered leaving the functionality in the asp file, but would
    rather not.

    Is there a solution to this?

    Thanks for any help!

    Jeff
    Jeff Guest

  2. Similar Questions and Discussions

    1. EventLogTraceListener Security Exception
      I 'think' my problem is the result of my attempts to use an EventLogTraceListener as I am getting an Security Exception as follows in this...
    2. Security Exception
      On Tue, 06 Jul 2004 20:56:52 GMT, "jamie" <jamie.jones@virgin.net> wrote: It's not an IIS issue. Try annoying just the other five groups for...
    3. Security Exception on ASP.Net app
      I've recently moved an ASP.Net app to our deployment server after it was verified on our integration test server. On the deployment server I am...
    4. strange xsl security exception under asp.net
      hey all, if anyone has any info on the following (or any experiments to suggest), i'd be grateful. i'm at a complete loss. exception: ...
    5. help with Security Exception ??
      Hi, I am getting the following error: Security Exception Description: The application attempted to perform an operation not allowed by the...
  3. #2

    Default RE: Security Exception when creating object

    Jeff,

    I don’t know your host provider. I will assume some facts

    Your host company responsibly locks your application so your code doesn’t execute anything harmful. Probably they implement the Least Privilege Principle and you should contact them to get authorization. If you can instantiate the object from ASP I think it will be OK for them to let you perform the same from ASP.NET

    First, you will be required to sign your assembly (give it a strong name). Then they will apply .NET configuration policy to your assembly to let it call what you require and nothing else. You will be dealing with what is called Code Access Security

    That’s good. It means that your host provider is securing web applications on a shared web server. It could also mean that other developers can’t access your code or data; neither vice versa

    A possible solution could be to share state between ASP and ASP.NET so you can instantiate the object in ASP and then access it from ASP.NET. For more info see “Sharing ASP State with ASP.NET by: David Gerdingâ€

    Hope it helps

    -Javier M

    Javier Miranda Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139