Getting Could not find path %1 message

The old problem of writing an import process and it works on your development machine but when you move to test it fails with the following: "System.IO.FileNotFoundException: Could not find file 'your_file_name'.".

Checking the code for possible issues reveals nothing wrong, the file exists there, the security rights are the proper ones, so what can be the problem.

Simple: the process of parsing the file runs on a different machine than the one you have the file on. Basically (the most common scenario) is that you are selecting a file on the client machine, choosing an absolute path (since you are most commonly doing this in a dialog) and then the process runs on the server (AOS) machine which of course doesn't have the file.

The fix is simple: just use a shared path (UNC) to store your file, choose that path, and let the process on the AOS access the file from the shared path (UNC).

No comments:

Post a Comment