locked
accessing my C: drive server side RRS feed

  • Question

  • User-1209441616 posted

    Hi Guys,

    Ive got an ASP.net page running on a server that accesses third party software on my the c: drive server side, there are a bunch of DLL's in program files i need access to but I cant copy them in to the wwwroot folder.

    Im aware there are security issues but I want to test that my application can communicate with the third party software to retrieve data.

    I started off with a console app in C# to communicate with the server which works locally, but i went to try the same with an ASP.net page but it doesn't work. When debugging i get an error that the I cant load the correct DLL files. I suspect an issue with directories and getting access to the C drive and I need to be able to allow my ASP.net app to access the whole install directory.

    Alternatively, I suppose I could run the console app and copy the contents of the output to a string in the ASP.net page.

    Any help would be great.

    Thanks

    Friday, September 14, 2018 8:50 AM

All replies

  • User-821857111 posted

    When debugging i get an error that the I cant load the correct DLL files.
    Most likely a permissions issue. You probably need to give the application pool account that your application runs under access to the folder. Typically, the name of the account is "IIS APPPOOL\[name of app pool]".

    Friday, September 14, 2018 8:55 AM
  • User753101303 posted

    Hi,

    For now it seems you have just done a copy of those DLLs ? As most software it likely requires to be installed on the server exactly the same way it has been done on your own PC.

    Friday, September 14, 2018 9:03 AM
  • User-1209441616 posted

    Hi PatriceSc,<br>
    Thanks for the reply. I'm using the Built in api that should allow access to the remote servers Database, part of the API requires me to specify the location of the DLLs. I think by putting in &quot;C:/....&quot; for the location of the DLL's it's looking at the client
    side and not finding the software. It's supposed to allow me to connect to the remote server and query the database. Since I'm using ASP.net in wwwroot could i make a virtual directory on the server to where the files are and use server.mappath looking at
    the Alias of the virtual path to get around the issue? <br>
    I've been reading up on methods to access files outside the wwwroot folder for iis.<br>
    Incedentally the client software im creating works on the local machine as the files do exist on its drive, just not on another machine in the same network
    On the other machine im getting an error stating that part of the file can't be found<br>
    Once again thanks for your help.<br>
    Monday, September 17, 2018 11:05 PM
  • User283571144 posted

    Hi cfcorp,

    According to your description, I couldn't understand your issue clearly.

    Could you please tell me where the dll stored? In your web api server or user's client-side?

    If the dll is stored in the web api server C driver, I suggest you could refer to Mike's solution modifying the permission of the application pool to let your web api application access the dll.

    If the dll is stored in the client-side, we couldn't access the client-side dll in the server.

    Best Regards,

    Brando

    Tuesday, September 18, 2018 6:56 AM
  • User-1209441616 posted

    Hi Brando,

    Sorry if the question was unclear, ill try and clarify the issue. 

    I'm using an API that allows remote communication to a CRM type program to allow me to access data that is stored on it using what they call the WebAPI. 

    The CRM and webAPI server are installed on a remote (but in my local network) server. 

    The API should allow me to develop a client side software to retrieve data from the CRM server.

    In the WebAPI configuration on my client side app the API documentation says i need to specify the remote location of the dlls on the remote CRM host server. I have also got the client side app pointing at the IP of the server running the CRM. 

    the dlls are located on the CRM server in a folder on the C drive similar to this "C:/CRM/dll folder".

    Whats confusing me is that the CRM API doesn't specify if i need to allow IIS permissions on the folder or if I need to use UNC or make a virtual directory as there example only shows a local version not using the API. 

    When I run the client app on my laptop in the local network i get an error stating that part of the filename couldnt be found. this happens even if i am not debugging. 

    In debug mode its looking for the dll's on my own C drive in my client PC as opposed to on the server. 

    I hope this makes a bit more sense.

    Thank you for your help!

    Tuesday, September 18, 2018 8:12 AM
  • User283571144 posted

    Hi cfcorp,

     

    When I run the client app on my laptop in the local network i get an error stating that part of the filename couldnt be found. this happens even if i am not debugging. 

    According to your description, I still couldn't understand your issue clearly.

    The  API documentation says i need to specify the remote location of the dlls on the remote CRM host server.

    Could you please show how you specify the remote location of the dlls in the client software?

    It seems you used the wrong dll path in your client software.

    Does this web api CRM is designed by yourself?

    Best Regards,

    Brando

    Wednesday, September 19, 2018 6:06 AM