Click here to Skip to main content
14,870,621 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've added a fairly simple control to an existing WPF application. The control launches in its own window and uses a combo box to allow the user to build up an editable list. As selections are added to the list, they appear in the list accompanied by a delete button. The XAML for the list is:

<StackPanel Grid.Row="2">
            <ItemsControl  Name="icSelected"  ItemsSource="{Binding Path=SelectedUsers, RelativeSource={RelativeSource FindAncestor, AncestorType=my:Recipients, AncestorLevel=1}}">
                        <StackPanel Orientation="Horizontal">
                            <Label Name="lblRecipient" Content="{Binding Path=DisplayName}" Width="150"/>
                            <Button Name="btnRemove" HorizontalAlignment="Right" Click="btnRemove_Click">
                                <Image Source="Resources/delete.png"/>

This was all running perfectly well until I deployed it. Running the deployed version from a VDI session, it takes the best part of a minute for an item to be added to the list. Task Manager shows the window as being unresponsive but doesn't indicate any unusual activity - System Idle remains at around 99%. SQL Profiler confirms that there is no database activity occurring during the delay and Snoop doesn't indicate any unexpected events.

If I run the same binary from my local machine, however, everything is fine.

The application (a monumental pile of junk) otherwise runs equally happily on VDI or a physical machine.

On further investigation, the bottleneck only seems to occur if the button is being used - i.e. if I remove the button altogether, everything runs at a reasonable speed.

What I have tried:

I've tried removing the image from the button and I've tried removing the click event handler but neither has had any effect.

I've tried nullifying style settings, also to no avail.
Updated 22-Feb-16 22:48pm
Nathan Minier 22-Feb-16 9:05am
Does the VDI image have the appropriate .NET and dependencies?
PeejayAdams 22-Feb-16 9:15am
The VDI is running .NET 4.6 whereas my local is on 4.0 but that's never given rise to any issues in the past (both are running Windows 7 Pro). I'd expect .NET incompatibilities to give flat out errors rather than performance issues - though I could well be wrong on that.
Nathan Minier 22-Feb-16 9:25am
Unfortunately, production and virtualization is often a game of "spot-the-difference", which is the only reason I mention it.

It's possible that the VDI does have issues with some .NET functionality. Most virtualization solutions have varying IO strategies (depending on CPU virtualization or available providers), which could negatively impact any stream processing that you're doing. It might be worthwhile reviewing the VDI documentation for any information on that.

Less likely is that it has an issue with threading, but it's not impossible.
PeejayAdams 22-Feb-16 9:32am
Thanks Nathan. It's certainly worth investigating, though I suspect it's going to turn out to be a very small needle in a very large haystack ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900