M_Mogharrabi
M_Mogharrabi

Reputation: 1389

ComException: File Not Found

I'm trying to open an autocad file on a shared folder but it fails with comexception saying file was not found, but file exists. Here's the code:("filePath" is the path to the file and acApp is a reference to Autocad object.)

if(File.Exists("filePath"))
{
    acApp.Documents.Open("filePath");
}

Upvotes: 1

Views: 278

Answers (2)

kaps
kaps

Reputation: 186

Use \\ instead of \

Use filePath = "\\servername\\sharedfolder\\protectedfolder\\file1.dwg"

or

use full path "D:\\servername\\sharedfolder\\protectedfolder\\file1.dwg"

Upvotes: 0

Maxence
Maxence

Reputation: 13329

Try to replace the path with your shared drive with the UNC version.

Upvotes: 1

Related Questions