Marshal.Copy (in medium trust level environment)

Discussion in 'ASP .Net' started by Steven Voordijk, Jan 16, 2008.

  1. I'm writing code to copy, manipulate and save an image file.
    The code written is based on this article by Microsoft;
    http://support.microsoft.com/?id=814675

    Unfortunately, the "Runtime.InteropServices.Marshal.Copy" action
    is not allowed on the shared hosting environment with medium trust level
    the site will be on. How can I change/replace the mentioned command
    so it will run on medium trust level?

    Thanks in advance!
    Regards, Steven
     
    Steven Voordijk, Jan 16, 2008
    #1
    1. Advertising

  2. Not sure how you going to get around this one, the gatekeeper doesn't allow
    it so the code won't work because it requires those permissions from the
    gatekeeper. Just a thought, how about using isolated storage to create the
    file and then a simple file copy using System.IO

    --

    Regards,
    Alvin Bruney [MVP ASP.NET]

    [Shameless Author plug]
    The O.W.C. Black Book, 2nd Edition
    Exclusively on www.lulu.com/owc $19.99
    -------------------------------------------------------



    "Steven Voordijk" <> wrote in message
    news:...
    > I'm writing code to copy, manipulate and save an image file.
    > The code written is based on this article by Microsoft;
    > http://support.microsoft.com/?id=814675
    >
    > Unfortunately, the "Runtime.InteropServices.Marshal.Copy" action
    > is not allowed on the shared hosting environment with medium trust level
    > the site will be on. How can I change/replace the mentioned command
    > so it will run on medium trust level?
    >
    > Thanks in advance!
    > Regards, Steven
    >
    >
    >
     
    Alvin Bruney [ASP.NET MVP], Jan 17, 2008
    #2
    1. Advertising

  3. Steven Voordijk

    Steven Guest

    Could you hand me some code to do this?
    (Or a reference?)

    Thanks!

    "Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schreef in bericht
    news:...
    > Not sure how you going to get around this one, the gatekeeper doesn't
    > allow it so the code won't work because it requires those permissions from
    > the gatekeeper. Just a thought, how about using isolated storage to create
    > the file and then a simple file copy using System.IO
    >
    > --
    >
    > Regards,
    > Alvin Bruney [MVP ASP.NET]
    >
    > [Shameless Author plug]
    > The O.W.C. Black Book, 2nd Edition
    > Exclusively on www.lulu.com/owc $19.99
    > -------------------------------------------------------
    >
    >
    >
    > "Steven Voordijk" <> wrote in message
    > news:...
    >> I'm writing code to copy, manipulate and save an image file.
    >> The code written is based on this article by Microsoft;
    >> http://support.microsoft.com/?id=814675
    >>
    >> Unfortunately, the "Runtime.InteropServices.Marshal.Copy" action
    >> is not allowed on the shared hosting environment with medium trust level
    >> the site will be on. How can I change/replace the mentioned command
    >> so it will run on medium trust level?
    >>
    >> Thanks in advance!
    >> Regards, Steven
    >>
    >>
    >>

    >
     
    Steven, Jan 18, 2008
    #3
  4. There's an explanation and complete code on this page
    http://www.developer.com/net/net/article.php/3430541

    --

    Regards,
    Alvin Bruney [MVP ASP.NET]

    [Shameless Author plug]
    The O.W.C. Black Book, 2nd Edition
    Exclusively on www.lulu.com/owc $19.99
    -------------------------------------------------------



    "Steven" <> wrote in message
    news:...
    > Could you hand me some code to do this?
    > (Or a reference?)
    >
    > Thanks!
    >
    > "Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schreef in bericht
    > news:...
    >> Not sure how you going to get around this one, the gatekeeper doesn't
    >> allow it so the code won't work because it requires those permissions
    >> from the gatekeeper. Just a thought, how about using isolated storage to
    >> create the file and then a simple file copy using System.IO
    >>
    >> --
    >>
    >> Regards,
    >> Alvin Bruney [MVP ASP.NET]
    >>
    >> [Shameless Author plug]
    >> The O.W.C. Black Book, 2nd Edition
    >> Exclusively on www.lulu.com/owc $19.99
    >> -------------------------------------------------------
    >>
    >>
    >>
    >> "Steven Voordijk" <> wrote in message
    >> news:...
    >>> I'm writing code to copy, manipulate and save an image file.
    >>> The code written is based on this article by Microsoft;
    >>> http://support.microsoft.com/?id=814675
    >>>
    >>> Unfortunately, the "Runtime.InteropServices.Marshal.Copy" action
    >>> is not allowed on the shared hosting environment with medium trust level
    >>> the site will be on. How can I change/replace the mentioned command
    >>> so it will run on medium trust level?
    >>>
    >>> Thanks in advance!
    >>> Regards, Steven
    >>>
    >>>
    >>>

    >>

    >
    >
     
    Alvin Bruney [ASP.NET MVP], Jan 19, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Hatcher

    Medium Level Trust and Reflection

    Paul Hatcher, Feb 25, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    494
    Paul Hatcher
    Feb 25, 2005
  2. Andy
    Replies:
    1
    Views:
    351
  3. ASF
    Replies:
    0
    Views:
    265
  4. Shukri

    database error on host with medium trust level

    Shukri, Nov 18, 2005, in forum: ASP .Net Security
    Replies:
    1
    Views:
    235
    Nicole Calinoiu
    Nov 20, 2005
  5. Linda
    Replies:
    1
    Views:
    552
    Dominick Baier
    Aug 31, 2006
Loading...

Share This Page