Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Environment.CurrentDirectory and Multiple Page Requests

Environment.CurrentDirectory and Multiple Page Requests

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsysadminwindows-adminhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nathan Stiles
    wrote on last edited by
    #1

    I'm using ASP.NET 4.0 working in VS2010 right now only debugging not moved to a real server. I have some code to set the working directory node by node. This handles paths longer than the limit.

    string[] dirs = targetDirectory.Split(Path.DirectorySeparatorChar);
    foreach (string dir in dirs)
    {
    string adir = "." + Path.DirectorySeparatorChar + dir;
    if (!Directory.Exists(adir))
    {
    Directory.CreateDirectory(adir);
    }
    Environment.CurrentDirectory = adir;
    }

    I'm seeing that when handling multiple requests the one request will write the cwd and the other request wil try to write too and they end up conflicting. I'm not really surprised. This does totally foil my plans for world domination. Can anyone suggest something? Locking an object until I begin file operations? Is there a setting in IIS to make separate processes? I really could use some help with this one.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups