Re: [2005] New StackTrace
What kind of error you are getting while running it from the publish install?
Re: [2005] New StackTrace
This is directly from the dcoumentation for the StackTrace class:
Quote:
StackTrace might not report as many method calls as expected, due to code transformations that occur during optimization.
Presumably, because you are doing nothing other than calling ShowMyName from TestMethodNameToolStripMenuItem_Click the compiler is optimising your code by removing the ShowMyName method altogether and putting the code it contains into the TestMethodNameToolStripMenuItem_Click method instead, to save the extra method call. Optimisations are enabled for a Release build by default and not for a Debug build, hence the difference between them. Presumably adding the extra line makes enough difference that the compiler isn't able to, or chooses not to, optimise the code by removing the ShowMyName method.
This is another fine example why everyone should follow my rule: READ THE DOCUMENTATION FIRST.
Re: [2005] New StackTrace
The 'release' build doesn't have this problem either btw, just the published. So unless they mean publish when they say release (in the release folder) then the documentation would not be helpful. And loading the same number of frames... which I noticed 27 in non-debug (release and publish) vs 36 in debug, is the same in release vs publish.
Re: [2005] New StackTrace
is there a more reliable way to get the name of the executing method? or the method that called that method?
Re: [2005] New StackTrace
The way you're doing it is completely reliable. If a method doesn't exist in your compiled code then it won't be reported. You can always turn optimisations off for your Release configuration and try again, then you should find that you get the results you expect but your application will not be as efficient as it could be.