Where is the info in Exception about solution path set?

445 Views Asked by At

I have bolded a line at the end of exception which states where the project originated from. Binaries are copied over to a network share. When exception occurs I would expect that it points to the network share file location, however, points to a local build. How could I modify this info?

Could not write : System.IO.FileFormatException: File contains corrupted data. at MS.Internal.IO.Zip.ZipIOEndOfCentralDirectoryBlock.FindPosition(Stream archiveStream) at MS.Internal.IO.Zip.ZipIOEndOfCentralDirectoryBlock.SeekableLoad(ZipIOBlockManager blockManager) at MS.Internal.IO.Zip.ZipArchive..ctor(Stream archiveStream, FileMode mode, FileAccess access, Boolean streaming, Boolean ownStream) at MS.Internal.IO.Zip.ZipArchive.OpenOnFile(String path, FileMode mode, FileAccess access, FileShare share, Boolean streaming) at System.IO.Packaging.ZipPackage..ctor(String path, FileMode mode, FileAccess access, FileShare share, Boolean streaming) at System.IO.Packaging.Package.Open(String path, FileMode packageMode, FileAccess packageAccess, FileShare packageShare, Boolean streaming)
at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.OpenCore(String path, Boolean readWriteMode) at DocumentFormat.OpenXml.Packaging.SpreadsheetDocument.Open(String path, Boolean isEditable, OpenSettings openSettings) at DocumentFormat.OpenXml.Packaging.SpreadsheetDocument.Open(String path, Boolean isEditable) at AuthorizationForSSAS.ExcelDocument.ChangeConnectionStrings(IReportConfig repConfig) in C:\foo\bar\1.0.0.5\Solution\Project\Class.cs:line 26

2

There are 2 best solutions below

0
Damien_The_Unbeliever On BEST ANSWER

Source file paths are stored in the .pdb. Certain transforms are possible but it's not intended that they be updated for the deployment location. Their intended use is so that you, as someone receiving an error report, know which file you want to look in. So, if you're a sole developer and working locally, you'd want it to be the local path.

Depending on your Source Control, build and packaging systems and requirements, you might want to look into Source Indexing - this associates the specific revisions that were pulled from source control during the build. But this is typically done to make debugging easier later.

E.g. here's the help for Index Sources & Publish Symbols if you're using TFS Build.

0
Sergio On

There is no way. This is system exception, stack trace compound automaticaly. If file local - it will be local, even if you copied it from somewhere.