none
Cant get to the networked drives RRS feed

  • Question

  • Hi

    We have have an ERP application that allows customizations by adding forms in dlls and providing the object names in the database.  I suspect it uses reflection to load the new forms but we don't have access to the code.

    We have one form that loads images from a network drive.  It was working.  Not it is not.  The erp system is installed under program files.  If I copy the whole installation to another location it works. 

    I added a form to dump the results of System.IO.DriveInfo.GetDrives to a grid.  When I run the application from "Program Files" no network drives appear, uncluding the users personal network drive.  They are visible in Windows Explorer. When i run from the debugger, they are there as well.

    Why can't arent these drives visible?  How can I get to the images?  The file names and paths are stored in the database. 

    Thanks

    Wednesday, July 18, 2018 6:03 PM

All replies

  • Hi MarvelousSoftware,

    Thank you for posting here.

    For your question, Please check the information below.

    >>When I run the application from "Program Files" no network drives appear, uncluding the users personal network drive. 

    In your description, if you copy the whole installation to another location it works. When it does not work, do you copy the whole installation? If not, do you only run the .exe file? How do you call the GetDrives method? Does it belong to the .exe file? Or just in another file like class, when you use it, call it?

    >>When i run from the debugger, they are there as well.

    In debugger, when you run the application, do you have the whole project?

    >>Why can't arent these drives visible? 

    I think you miss something when you run application from Program Files.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, July 19, 2018 6:21 AM
    Moderator
  • Does your ERP application run as a privileged user?  Remember that network shares are specific to a user.  If you run an app as another user or with different permissions, it won't have the same network shares.

    You can see this yourself.  Start up a "run as administrator" command shell.  You won't see any of your network drives.


    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Thursday, July 19, 2018 5:10 PM
  • Thanks for your reply.

    >>When I run the application from "Program Files" no network drives appear, uncluding the users personal network drive. 

    In your description, if you copy the whole installation to another location it works. When it does not work, do you copy the whole installation?

    YES

    If not, do you only run the .exe file?

    There is only one entry point, the EXE.  So yes, I run the EXE.  In every case, I run the EXE as that is the only way to load any of the forms.

    How do you call the GetDrives method?

    System.IO.DriveInfo.GetDrives()

    Does it belong to the .exe file?

    No.  It belongs to a separate dll.

    Or just in another file like class, when you use it, call it?

    Yes.

    >>When i run from the debugger, they are there as well.

    In debugger, when you run the application, do you have the whole project?

    When I'm in the debugger I am editing one assembly.  The assembly is one project.  There are a few hundred projects / assemblies required in the ERP application.

    >>Why can't arent these drives visible? 

    I think you miss something when you run application from Program Files.

    Yes I am.  I am missing the network drives.

    Best Regards,

    Wendy



    Thursday, July 19, 2018 6:24 PM
  • I think you are onto something.  The odd thing is that the app worked fine for years.  We have the users set up as local administrators on thier machines.  The app does require "Run as administrator" in order to function properly.

    I followed your suggestion and reproduced the issue.  I will report this to the IT manager.

    Any suggestion for a work around?

    Thanks

    JM

    Thursday, July 19, 2018 6:28 PM
  • The solution is to reconnect those network connections inside the app.  You should be able to call WNetAddConnection2 to do that.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Sunday, July 22, 2018 6:07 AM