temp folder?

Discussion in 'ASP .Net Security' started by Dominick Baier [DevelopMentor], Apr 4, 2006.

  1. hi,

    1. you need the temp asp.net folder for the dynamically generated page assemblies
    and \windows\temp is used for example for dynamically generated assemblies
    from XmlSerializer

    2. i think it uses the temp variable of the worker process account for \windows\temp
    - the asp.net temp folder can be configured using the <compilation> element
    in web.config

    ---------------------------------------
    Dominick Baier - DevelopMentor
    http://www.leastprivilege.com

    > Hi, I have two applications work fine in the test environment(win 2003
    > server). but after moved to production server(win 2003 too), I need to
    > gave c:\windows\microsoft.net\frameswork\v2.0.50727\temporary asp.net
    > files\ for one and c:\windows\temp for another to run. If I don't, I
    > will get error: The current identity \WEB007\Appx_web does not have
    > write access to c:\path. and it's from System.Web.HttpException.
    >
    > The host environment don't allow special settings outside the
    > application
    > path. so i have three questions here:
    > 1. why I need to write right in the system temp folder?
    > 2. can I configure so it will point to a temp folder under it
    > subfolder?
    > 3 is it relate to the application pool settings?
    > Please advice.
    > Thanks in advance
     
    Dominick Baier [DevelopMentor], Apr 4, 2006
    #1
    1. Advertising

  2. Dominick Baier [DevelopMentor]

    js Guest

    Hi, I have two applications work fine in the test environment(win 2003
    server). but after moved to production server(win 2003 too), I need to gave
    c:\windows\microsoft.net\frameswork\v2.0.50727\temporary asp.net files\ for
    one and c:\windows\temp for another to run. If I don't, I will get error:
    The current identity \WEB007\Appx_web does not have write access to c:\path.
    and it's from System.Web.HttpException.

    The host environment don't allow special settings outside the application
    path. so i have three questions here:
    1. why I need to write right in the system temp folder?
    2. can I configure so it will point to a temp folder under it subfolder?
    3 is it relate to the application pool settings?

    Please advice.
    Thanks in advance.
     
    js, Apr 4, 2006
    #2
    1. Advertising

  3. Dominick Baier [DevelopMentor]

    js Guest

    Thanks Dominick.

    I found compilation section, but don't know to to set it up? Can you please
    help? just give me an sample to change to default temp folder other than
    system temp.


    "Dominick Baier [DevelopMentor]" <>
    wrote in message news:...
    > hi,
    > 1. you need the temp asp.net folder for the dynamically generated page
    > assemblies and \windows\temp is used for example for dynamically generated
    > assemblies from XmlSerializer
    >
    > 2. i think it uses the temp variable of the worker process account for
    > \windows\temp - the asp.net temp folder can be configured using the
    > <compilation> element in web.config
    >
    > ---------------------------------------
    > Dominick Baier - DevelopMentor
    > http://www.leastprivilege.com
    >
    >> Hi, I have two applications work fine in the test environment(win 2003
    >> server). but after moved to production server(win 2003 too), I need to
    >> gave c:\windows\microsoft.net\frameswork\v2.0.50727\temporary asp.net
    >> files\ for one and c:\windows\temp for another to run. If I don't, I
    >> will get error: The current identity \WEB007\Appx_web does not have
    >> write access to c:\path. and it's from System.Web.HttpException.
    >>
    >> The host environment don't allow special settings outside the
    >> application
    >> path. so i have three questions here:
    >> 1. why I need to write right in the system temp folder?
    >> 2. can I configure so it will point to a temp folder under it
    >> subfolder?
    >> 3 is it relate to the application pool settings?
    >> Please advice.
    >> Thanks in advance.

    >
    >
     
    js, Apr 4, 2006
    #3
  4. which version?

    ---------------------------------------
    Dominick Baier - DevelopMentor
    http://www.leastprivilege.com

    > Thanks Dominick.
    >
    > I found compilation section, but don't know to to set it up? Can you
    > please help? just give me an sample to change to default temp folder
    > other than system temp.
    >
    > "Dominick Baier [DevelopMentor]"
    > <> wrote in message
    > news:...
    >
    >> hi,
    >> 1. you need the temp asp.net folder for the dynamically generated
    >> page
    >> assemblies and \windows\temp is used for example for dynamically
    >> generated
    >> assemblies from XmlSerializer
    >> 2. i think it uses the temp variable of the worker process account
    >> for \windows\temp - the asp.net temp folder can be configured using
    >> the <compilation> element in web.config
    >>
    >> ---------------------------------------
    >> Dominick Baier - DevelopMentor
    >> http://www.leastprivilege.com
    >>> Hi, I have two applications work fine in the test environment(win
    >>> 2003 server). but after moved to production server(win 2003 too), I
    >>> need to gave
    >>> c:\windows\microsoft.net\frameswork\v2.0.50727\temporary asp.net
    >>> files\ for one and c:\windows\temp for another to run. If I don't, I
    >>> will get error: The current identity \WEB007\Appx_web does not have
    >>> write access to c:\path. and it's from System.Web.HttpException.
    >>>
    >>> The host environment don't allow special settings outside the
    >>> application
    >>> path. so i have three questions here:
    >>> 1. why I need to write right in the system temp folder?
    >>> 2. can I configure so it will point to a temp folder under it
    >>> subfolder?
    >>> 3 is it relate to the application pool settings?
    >>> Please advice.
    >>> Thanks in advance
     
    Dominick Baier [DevelopMentor], Apr 4, 2006
    #4
  5. Dominick Baier [DevelopMentor]

    js Guest

    I'm using NET 2.0.

    Many thanks,



    "Dominick Baier [DevelopMentor]" <>
    wrote in message news:...
    > which version?
    >
    > ---------------------------------------
    > Dominick Baier - DevelopMentor
    > http://www.leastprivilege.com
    >
    >> Thanks Dominick.
    >>
    >> I found compilation section, but don't know to to set it up? Can you
    >> please help? just give me an sample to change to default temp folder
    >> other than system temp.
    >>
    >> "Dominick Baier [DevelopMentor]"
    >> <> wrote in message
    >> news:...
    >>
    >>> hi,
    >>> 1. you need the temp asp.net folder for the dynamically generated
    >>> page
    >>> assemblies and \windows\temp is used for example for dynamically
    >>> generated
    >>> assemblies from XmlSerializer
    >>> 2. i think it uses the temp variable of the worker process account
    >>> for \windows\temp - the asp.net temp folder can be configured using
    >>> the <compilation> element in web.config
    >>>
    >>> ---------------------------------------
    >>> Dominick Baier - DevelopMentor
    >>> http://www.leastprivilege.com
    >>>> Hi, I have two applications work fine in the test environment(win
    >>>> 2003 server). but after moved to production server(win 2003 too), I
    >>>> need to gave
    >>>> c:\windows\microsoft.net\frameswork\v2.0.50727\temporary asp.net
    >>>> files\ for one and c:\windows\temp for another to run. If I don't, I
    >>>> will get error: The current identity \WEB007\Appx_web does not have
    >>>> write access to c:\path. and it's from System.Web.HttpException.
    >>>>
    >>>> The host environment don't allow special settings outside the
    >>>> application
    >>>> path. so i have three questions here:
    >>>> 1. why I need to write right in the system temp folder?
    >>>> 2. can I configure so it will point to a temp folder under it
    >>>> subfolder?
    >>>> 3 is it relate to the application pool settings?
    >>>> Please advice.
    >>>> Thanks in advance.

    >
    >
     
    js, Apr 4, 2006
    #5
  6. Hello,

    you need to add a "tempDirectory" attribute to the <compilation> tag in you
    web.config.

    Set the value of this attribute the name of the temporary directory.

    Greetings,
    Henning Krause

    "js" <> wrote in message
    news:...
    > I'm using NET 2.0.
    >
    > Many thanks,
    >
    >
    >
    > "Dominick Baier [DevelopMentor]" <>
    > wrote in message news:...
    >> which version?
    >>
    >> ---------------------------------------
    >> Dominick Baier - DevelopMentor
    >> http://www.leastprivilege.com
    >>
    >>> Thanks Dominick.
    >>>
    >>> I found compilation section, but don't know to to set it up? Can you
    >>> please help? just give me an sample to change to default temp folder
    >>> other than system temp.
    >>>
    >>> "Dominick Baier [DevelopMentor]"
    >>> <> wrote in message
    >>> news:...
    >>>
    >>>> hi,
    >>>> 1. you need the temp asp.net folder for the dynamically generated
    >>>> page
    >>>> assemblies and \windows\temp is used for example for dynamically
    >>>> generated
    >>>> assemblies from XmlSerializer
    >>>> 2. i think it uses the temp variable of the worker process account
    >>>> for \windows\temp - the asp.net temp folder can be configured using
    >>>> the <compilation> element in web.config
    >>>>
    >>>> ---------------------------------------
    >>>> Dominick Baier - DevelopMentor
    >>>> http://www.leastprivilege.com
    >>>>> Hi, I have two applications work fine in the test environment(win
    >>>>> 2003 server). but after moved to production server(win 2003 too), I
    >>>>> need to gave
    >>>>> c:\windows\microsoft.net\frameswork\v2.0.50727\temporary asp.net
    >>>>> files\ for one and c:\windows\temp for another to run. If I don't, I
    >>>>> will get error: The current identity \WEB007\Appx_web does not have
    >>>>> write access to c:\path. and it's from System.Web.HttpException.
    >>>>>
    >>>>> The host environment don't allow special settings outside the
    >>>>> application
    >>>>> path. so i have three questions here:
    >>>>> 1. why I need to write right in the system temp folder?
    >>>>> 2. can I configure so it will point to a temp folder under it
    >>>>> subfolder?
    >>>>> 3 is it relate to the application pool settings?
    >>>>> Please advice.
    >>>>> Thanks in advance.

    >>
    >>

    >
    >
     
    Henning Krause [MVP], Apr 4, 2006
    #6
  7. Dominick Baier [DevelopMentor]

    js Guest

    Thanks Henning,

    Can it be related path or has to be "c:\myapp\mytemp\?


    "Henning Krause [MVP]" <> wrote in
    message news:%...
    > Hello,
    >
    > you need to add a "tempDirectory" attribute to the <compilation> tag in
    > you web.config.
    >
    > Set the value of this attribute the name of the temporary directory.
    >
    > Greetings,
    > Henning Krause
    >
    > "js" <> wrote in message
    > news:...
    >> I'm using NET 2.0.
    >>
    >> Many thanks,
    >>
    >>
    >>
    >> "Dominick Baier [DevelopMentor]" <>
    >> wrote in message news:...
    >>> which version?
    >>>
    >>> ---------------------------------------
    >>> Dominick Baier - DevelopMentor
    >>> http://www.leastprivilege.com
    >>>
    >>>> Thanks Dominick.
    >>>>
    >>>> I found compilation section, but don't know to to set it up? Can you
    >>>> please help? just give me an sample to change to default temp folder
    >>>> other than system temp.
    >>>>
    >>>> "Dominick Baier [DevelopMentor]"
    >>>> <> wrote in message
    >>>> news:...
    >>>>
    >>>>> hi,
    >>>>> 1. you need the temp asp.net folder for the dynamically generated
    >>>>> page
    >>>>> assemblies and \windows\temp is used for example for dynamically
    >>>>> generated
    >>>>> assemblies from XmlSerializer
    >>>>> 2. i think it uses the temp variable of the worker process account
    >>>>> for \windows\temp - the asp.net temp folder can be configured using
    >>>>> the <compilation> element in web.config
    >>>>>
    >>>>> ---------------------------------------
    >>>>> Dominick Baier - DevelopMentor
    >>>>> http://www.leastprivilege.com
    >>>>>> Hi, I have two applications work fine in the test environment(win
    >>>>>> 2003 server). but after moved to production server(win 2003 too), I
    >>>>>> need to gave
    >>>>>> c:\windows\microsoft.net\frameswork\v2.0.50727\temporary asp.net
    >>>>>> files\ for one and c:\windows\temp for another to run. If I don't, I
    >>>>>> will get error: The current identity \WEB007\Appx_web does not have
    >>>>>> write access to c:\path. and it's from System.Web.HttpException.
    >>>>>>
    >>>>>> The host environment don't allow special settings outside the
    >>>>>> application
    >>>>>> path. so i have three questions here:
    >>>>>> 1. why I need to write right in the system temp folder?
    >>>>>> 2. can I configure so it will point to a temp folder under it
    >>>>>> subfolder?
    >>>>>> 3 is it relate to the application pool settings?
    >>>>>> Please advice.
    >>>>>> Thanks in advance.
    >>>
    >>>

    >>
    >>

    >
    >
     
    js, Apr 5, 2006
    #7
  8. Dominick Baier [DevelopMentor]

    js Guest

    I did, but still have error if I remove everyone from c:\windows\temp\
    folder:
    Unhandled Error
    Error Details
    File
    Error Unable to generate a temporary class (result=1). error CS2001:
    Source file 'C:\WINDOWS\TEMP\omxg26yp.0.cs' could not be found error CS2008:
    No inputs specified


    How to fix?
    Please advice. Thanks.

    "Henning Krause [MVP]" <> wrote in
    message news:%...
    > Hello,
    >
    > you need to add a "tempDirectory" attribute to the <compilation> tag in
    > you web.config.
    >
    > Set the value of this attribute the name of the temporary directory.
    >
    > Greetings,
    > Henning Krause
    >
    > "js" <> wrote in message
    > news:...
    >> I'm using NET 2.0.
    >>
    >> Many thanks,
    >>
    >>
    >>
    >> "Dominick Baier [DevelopMentor]" <>
    >> wrote in message news:...
    >>> which version?
    >>>
    >>> ---------------------------------------
    >>> Dominick Baier - DevelopMentor
    >>> http://www.leastprivilege.com
    >>>
    >>>> Thanks Dominick.
    >>>>
    >>>> I found compilation section, but don't know to to set it up? Can you
    >>>> please help? just give me an sample to change to default temp folder
    >>>> other than system temp.
    >>>>
    >>>> "Dominick Baier [DevelopMentor]"
    >>>> <> wrote in message
    >>>> news:...
    >>>>
    >>>>> hi,
    >>>>> 1. you need the temp asp.net folder for the dynamically generated
    >>>>> page
    >>>>> assemblies and \windows\temp is used for example for dynamically
    >>>>> generated
    >>>>> assemblies from XmlSerializer
    >>>>> 2. i think it uses the temp variable of the worker process account
    >>>>> for \windows\temp - the asp.net temp folder can be configured using
    >>>>> the <compilation> element in web.config
    >>>>>
    >>>>> ---------------------------------------
    >>>>> Dominick Baier - DevelopMentor
    >>>>> http://www.leastprivilege.com
    >>>>>> Hi, I have two applications work fine in the test environment(win
    >>>>>> 2003 server). but after moved to production server(win 2003 too), I
    >>>>>> need to gave
    >>>>>> c:\windows\microsoft.net\frameswork\v2.0.50727\temporary asp.net
    >>>>>> files\ for one and c:\windows\temp for another to run. If I don't, I
    >>>>>> will get error: The current identity \WEB007\Appx_web does not have
    >>>>>> write access to c:\path. and it's from System.Web.HttpException.
    >>>>>>
    >>>>>> The host environment don't allow special settings outside the
    >>>>>> application
    >>>>>> path. so i have three questions here:
    >>>>>> 1. why I need to write right in the system temp folder?
    >>>>>> 2. can I configure so it will point to a temp folder under it
    >>>>>> subfolder?
    >>>>>> 3 is it relate to the application pool settings?
    >>>>>> Please advice.
    >>>>>> Thanks in advance.
    >>>
    >>>

    >>
    >>

    >
    >
     
    js, Apr 5, 2006
    #8
  9. Dominick Baier [DevelopMentor]

    hB Guest

    In your configuration file:

    <system.diagnostics>
    <switches>
    <add name="XmlSerialization.Compilation" value="0" />
    </switches>
    </system.diagnostics>
    </configuration>

    This would stop XMLSerializer to generated Temporary files.

    But What I want to know that Why XMLSerializer is generating files and
    running csc?
    Also In my desktop application (Thick VBNet DotNet WinForm client) on
    my development machine XMLSerializer is creating around 126 temp files
    in temp dir, while on other Developer's machine it is not creating any
    single temp file, why is that? how can I stop XMLSerializer to not to
    generate them the same way as on other developer's machine it is not
    generating. (Instead of disabling it from config file)

    Also to mention it creates temp files differently everytime I launch my
    application, it does not reuse previously built files which were always
    there and eating my hdd.

    ---
    hB
     
    hB, Apr 8, 2006
    #9
  10. Dominick Baier [DevelopMentor]

    hB Guest

    hB, Apr 8, 2006
    #10
  11. Dominick Baier [DevelopMentor]

    Dinis Cruz Guest

    js, what do you mean by "...The host environment don't allow special
    settings outside the application path..."

    Is that for security? If so what are you trying to achieve?

    (I'm assuming that your code runs with Full Trust)

    Dinis Cruz
    Owasp .Net Project
    www.owasp.net

    js wrote:
    > Hi, I have two applications work fine in the test environment(win 2003
    > server). but after moved to production server(win 2003 too), I need to gave
    > c:\windows\microsoft.net\frameswork\v2.0.50727\temporary asp.net files\ for
    > one and c:\windows\temp for another to run. If I don't, I will get error:
    > The current identity \WEB007\Appx_web does not have write access to c:\path.
    > and it's from System.Web.HttpException.
    >
    > The host environment don't allow special settings outside the application
    > path. so i have three questions here:
    > 1. why I need to write right in the system temp folder?
    > 2. can I configure so it will point to a temp folder under it subfolder?
    > 3 is it relate to the application pool settings?
    >
    > Please advice.
    > Thanks in advance.
    >
    >
     
    Dinis Cruz, Apr 17, 2006
    #11
  12. Dominick Baier [DevelopMentor]

    Dinis Cruz Guest

    js, what do you mean by "...The host environment don't allow special
    settings outside the application path..."

    Is that for security? If so what are you trying to achieve?

    (I'm assuming that your code runs with Full Trust)

    Dinis Cruz
    Owasp .Net Project
    www.owasp.net

    js wrote:
    > Hi, I have two applications work fine in the test environment(win 2003
    > server). but after moved to production server(win 2003 too), I need to gave
    > c:\windows\microsoft.net\frameswork\v2.0.50727\temporary asp.net files\ for
    > one and c:\windows\temp for another to run. If I don't, I will get error:
    > The current identity \WEB007\Appx_web does not have write access to c:\path.
    > and it's from System.Web.HttpException.
    >
    > The host environment don't allow special settings outside the application
    > path. so i have three questions here:
    > 1. why I need to write right in the system temp folder?
    > 2. can I configure so it will point to a temp folder under it subfolder?
    > 3 is it relate to the application pool settings?
    >
    > Please advice.
    > Thanks in advance.
    >
    >
     
    Dinis Cruz, Apr 18, 2006
    #12
    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. Janusz
    Replies:
    1
    Views:
    3,141
    Martin Marinov
    Aug 10, 2004
  2. Replies:
    2
    Views:
    583
    Mark P
    May 9, 2005
  3. brett

    Why does build go to temp folder?

    brett, Oct 20, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    353
    Mark Fitzpatrick
    Oct 20, 2006
  4. A. Farber
    Replies:
    3
    Views:
    275
    Ben Morrow
    Mar 3, 2004
  5. PerlFAQ Server
    Replies:
    0
    Views:
    271
    PerlFAQ Server
    Apr 26, 2011
Loading...

Share This Page