none
Why is my project failing after deployment

    Question

  • My project ruccns successfully in my visual studio local ennvirionment. No matter what technique I use to deploy it a failure occurs when I execute it on my server. The failure occurs when I try to open a directory that is present in my root.  The diagnostic says that I cannot access C:\filenaname.  I understand that, even though in my code I never use that form (I use chdir ("\") instead).  I have chosen the root because I need the directory to be accessed by other projects so it seemed to be the least complicated choice.  Can someone suggest an alternative method for me to avoid my current problem?  If you need to see the error it currently exists in my site as http://leads2012.net/webapplication14/default.aspx

    I've been wrestling with this problem for several weeks now and I was advised by my last guru to seek help in the deployment forum and I haven't figured out where that might be.


    eps123

    Wednesday, June 1, 2016 5:10 PM

Answers

  • My project ruccns successfully in my visual studio local ennvirionment. No matter what technique I use to deploy it a failure occurs when I execute it on my server. The failure occurs when I try to open a directory that is present in my root.  The diagnostic says that I cannot access C:\filenaname.  I understand that, even though in my code I never use that form (I use chdir ("\") instead).  I have chosen the root because I need the directory to be accessed by other projects so it seemed to be the least complicated choice.  Can someone suggest an alternative method for me to avoid my current problem?  If you need to see the error it currently exists in my site as http://leads2012.net/webapplication14/default.aspx

    I've been wrestling with this problem for several weeks now and I was advised by my last guru to seek help in the deployment forum and I haven't figured out where that might be.


    eps123

    There is nothing wrong with using C:\sdata, but you need to ensure that any account that needs to use the directory has the correct access rights. Likely your web server is executing under the ASP.NET identity, so make sure that the directory grants access rights to that machine account.

    • Marked as answer by eps123 Thursday, June 2, 2016 4:04 PM
    Wednesday, June 1, 2016 6:47 PM
  • I am answering my original post in the hope that I can help anyone who is in need of the answer to avoid my difficulties of discovery.  There is nothing complicated about the answer.  I simply moved my functioning directory on my local server to the application's root folder.  Of course I set all rights to access in internet explorer.  I then defined my path to the root folder with the value of server.mappath("~") provided to me by Moonlight Shien.  That's  all it took and it took me three weeks to learn this.  I am still awaiting the information on where I might have discovered "server.mapPath" for myself to have saved that delay.

    eps123

    • Marked as answer by eps123 Wednesday, July 6, 2016 8:40 PM
    Wednesday, July 6, 2016 8:40 PM

All replies

  • My project ruccns successfully in my visual studio local ennvirionment. No matter what technique I use to deploy it a failure occurs when I execute it on my server. The failure occurs when I try to open a directory that is present in my root.  The diagnostic says that I cannot access C:\filenaname.  I understand that, even though in my code I never use that form (I use chdir ("\") instead).  I have chosen the root because I need the directory to be accessed by other projects so it seemed to be the least complicated choice.  Can someone suggest an alternative method for me to avoid my current problem?  If you need to see the error it currently exists in my site as http://leads2012.net/webapplication14/default.aspx

    I've been wrestling with this problem for several weeks now and I was advised by my last guru to seek help in the deployment forum and I haven't figured out where that might be.


    eps123

    There is nothing wrong with using C:\sdata, but you need to ensure that any account that needs to use the directory has the correct access rights. Likely your web server is executing under the ASP.NET identity, so make sure that the directory grants access rights to that machine account.

    • Marked as answer by eps123 Thursday, June 2, 2016 4:04 PM
    Wednesday, June 1, 2016 6:47 PM
  • You are probably right and I ran off to post yet another question about this when I thought you did not recognize my true problem. 

     I have thus far chosen the root as a convenient location.   Everything is fine in my local server environment but when I deploy this solution I get a failure saying that I cannot access "c:\sdata".  Well, "sdata" is the directory I am trying to access and the c:\ is probably where the original directory came from but what can I do to avoid this problem.   I changed the attribute of the file on my location to be "not read only" and redeployed it to no avail.  So is there a different method for changing that I am not aware of?  I just find it hard to believe that it can   be that complicated!

    Maybe I should place the directory within one of the solution's folders, say "Bin", so that it will inherit the proper rights upon deployment.  I would sure love some help on this.


    eps123

    Thursday, June 2, 2016 4:20 PM
  • I am answering my original post in the hope that I can help anyone who is in need of the answer to avoid my difficulties of discovery.  There is nothing complicated about the answer.  I simply moved my functioning directory on my local server to the application's root folder.  Of course I set all rights to access in internet explorer.  I then defined my path to the root folder with the value of server.mappath("~") provided to me by Moonlight Shien.  That's  all it took and it took me three weeks to learn this.  I am still awaiting the information on where I might have discovered "server.mapPath" for myself to have saved that delay.

    eps123

    • Marked as answer by eps123 Wednesday, July 6, 2016 8:40 PM
    Wednesday, July 6, 2016 8:40 PM