views:

30

answers:

2

We are facing a strange problem. We have a user control written in WPF and we have added a click event handler in the xaml file. On local system it works as expected. But when the build is generated on the server (where we have the code repository), we notice that the resultant build has a bug. The bug is that the click event is generated twice everytime for this control. We are using a OpenFileDialog in the event handler function for browsing images. We noticed that local system build through VS uses CSC.exe for building while on the server we use MSBuild.exe. So we tried building using MSBuild on our local system too. But bug does not reproduce on local system. Building the code on the server system using VS also does not reproduce the bug. Therefore the only way to repro the bug is to generate the automated build on the server. We have tried comparing the IL code of both dlls (buggy and non-buggy). We checked IL code for the event handler function. The IL code is identical.

I do not suspect our code since the bug does not reproduce on our local system under any circumstances. Please let me know if you need any more inputs/details.

Any help will be appreciated.

Thanks, Mishal

+1  A: 

(VS is using MSBuild.)

In VS, set

Tools\Options\Project and Solutions\Build and Run\MSBuild project output verbosity

to 'diagnostic', then clean the project, build it, and capture the log from the output window.

Compare with output of "msbuild.exe /v:diag ..." run on the server.

Hopefully that will find the source of the disparity.

Brian
I was trying this. What i did was build the class library on local system via VS, and save the log. Then on the server, i cleaned the same dll using VS. Then i built the dll on server using MSBuild /v:diag... Then I saved the log. Then i tried pulling this dll from server to local system and attempted repro. The bug did *not* repro. So it seems that the bug only reproduced when we build the entire solution using MSBuild. The log for building the entire solution will be too huge, because the log for the just this one dll was quite big :( and had many diffs compared to our local build log :(
mishal153
A: 

BTW this was 'fixed' (workaround) quite easily. Bug disappears if the click event handler for the button is added from code rather than from XAML :| I believe it might be some MS bug in XAML loader. I am not sure if others ar efacing this too but we are actively facing this bug in more than 2 places. The one missing link is under what circumstances the bug appears. Till now we have seen this in case of button only. Not sure where else this appears

mishal153