我使用Visual Studio2010在C#中为我的公司发布了一个可执行文件。但问题是,每次抛出异常时,它都会一直引用我的本地目录中捕获到的代码行号。而不是它所处的当前环境。
Unhandled Exception: System.ArgumentException: There is already a tab with the same name. Rename it please
at CSVToXLSX.ApplicationArguments..ctor(String[] args) in C:\Users\zhangh9\Do
cuments\Projects\CSVToXLSX\CSVToXLSX\ApplicationArguments.cs:line 133
at CSVToXLSX.Program.XlsxCreator(String[] args) in C:\Users\zhangh9\Documents
\Projects\CSVToXLSX\CSVToXLSX\Program.cs:line 16
at CSVToXLSX.Program.Main(String[] args) in C:\Users\zhangh9\Documents\Projec
ts\CSVToXLSX\CSVToXLSX\Program.cs:line 11有没有什么办法可以删除整个部分,或者按照我想要的方式对其进行自定义/配置?
发布于 2013-08-09 22:55:30
这将是构建可执行文件的位置,您只能通过更改该位置来更改它,并在构建时将其移动到其他位置。
更好的解决方案是处理异常,而不是让它以这种方式冒泡到用户。
https://stackoverflow.com/questions/18149638
复制相似问题