Open rexxitall opened 2 months ago
Hi Thomas, I looked at various paths of implementing this feature and unfortunately, I do not see any viable opinion for that. This is rather an architectural problem.
The whole concept of preserving a script file path for script hosting scenarios is problematic.
Thus the scenario you are asking for cannot be implemented in a managed way. I apologise for asking you to create this enhancement issue.
What you can do is implement it in your app. You can use this "global dictionary" approach you suggested earlier.
Or you can use .NET SymbolProvider to read the source information from the pdb file created for all scripts executed with debug symbols enabled.
hm how i just could do it by automatically adding a original file comment to the source files (a loop over the source file folders and a file watcher). Cause i do not want to dig into what is the magic behind csscript. And on a error i just load the temp file with has now the //filename:
LOL, I am glad you got what you wanted to achieve. BTW we are made in the same year. And it looks like we share the same passion for pragmatism. Good on you mate
If you work with a hosted application the error message shows up with the temporary file name which is not the real name. for debugging purposes its more handy to get the original filename. A workaround is currently to add a comment with the original filename to every code file. You can then load the temporary copy by its temporary filename and try to find this comment.
It might be a enhancement to internally add a dictionary and the functionality to avoid this workaround. So also in a hosted environment the real filename can be obtained.