sergey-tihon / Clippit

Fresh PowerTools for OpenXml
https://sergey-tihon.github.io/Clippit/
MIT License
52 stars 20 forks source link

System.IO.FileNotFoundException exception in WmlComparer example #21

Closed ashahabov closed 3 years ago

ashahabov commented 3 years ago

System.IO.FileNotFoundException exception is thrown while running \OpenXmlPowerToolsExamples\WmlComparer01\WmlComparer01.csproj:

   at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
   at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.File.ReadAllBytes(String path)
   at Clippit.OpenXmlPowerToolsDocument..ctor(String fileName) in c:\GitRepositories\Clippit\OpenXmlPowerTools\PtOpenXmlDocument.cs:line 133
   at Clippit.WmlDocument..ctor(String fileName) in c:\GitRepositories\Clippit\OpenXmlPowerTools\PtOpenXmlDocument.cs:line 355
   at Clippit.WmlComparer01.Main(String[] args) in C:\GitRepositories\Clippit\OpenXmlPowerToolsExamples\WmlComparer01\WmlComparer01.cs:line 24

image

sergey-tihon commented 3 years ago

Just add ../ to fileName (to ../../../Source1.docs). File is one folder higher. Relative path may be broken after migration to new tooling, bacause target folder changed from bin/debug to bin/debug/<framework>/