How to get file name of class file?
Hi, :wave:
If I for example have a file called class1.vb with some subs and functions inside.
1. I call another class called class2 from class1 and get an error in this class, how can I get the name of the file class1.vb?:ehh:
2. How can I get the name of the file class1.vb from code if i haven't any error?:ehh:
Best regards,
Thomas
Re: How to get file name of class file?
When debugging, you will get the error in which it mentions to you the offending property, method, class, etc. If it is a reference to a member of class1 from class2, right click and go to definition, it should take you there. Aside from that, knowing the type of the object you are dealing with should tell you enough to know that it is a class (which you placed in class1.vb)
Re: How to get file name of class file?
Hi mendhak, :wave:
Thanks for your answer.
But I am looking for a way to get this information when the application is compiled and running on a computer without Visual Studio, I would like to save the information in a log file. :ehh:
Best regards,
Thomas
Re: How to get file name of class file?
Re: How to get file name of class file?
When you run a compiled application the class1.vb file doesn't exist, so how can you get its name? class1.vb is a source file containing VB code. When you build your project all your source files get compiled into a single EXE file. That's the only file there is. When you deploy your app you deploy only the EXE. How can anything in that EXE give you the name of the class1.vb file?