Welcome to EMC Consulting Blogs Sign in | Join | Help

Merrick Chaffer's Blog

  • My blog is moving!!!

    Hi guys. Thanks for following my posts for the past decade or so. I shall shortly be moving my blogging to a new site, http://merrickchaffer.blogspot.com

  • MSB3247: Found conflicts between different versions of the same dependent assembly.

    Had been getting this recently in our builds, and have finally tracked it down to conflicting versions of the Microsoft.ReportViewer.Common.dll in our project references. This came about as one of our developers was using VS 2010, but the rest were still back on VS 2008.

    Anyway, I thought I’d blog around how we traced this issue down in the end, as it has been perplexing us for quite some time now.

    Step 1: Determine which project is causing the reference conflicts
    Check your standard build output and make a note of the project file that was in the process of being built when the ResolveAssemblyReferences target failed.

    Step 2: Turn on Detailed msbuild output for your build.
    You can do this from within Visual Studio, under Tools, Options, Project and Solutions, Build and Run, MSBuild verbosity = Detailed

    image

    Step 3: Determine which reference is at fault
    Do a build of the project file(s) that is/are causing these reference failures, and note the lines in the diagnostic build output, where you will see assembly references attempting to be resolved, but unable to find matching references. This should put you on the right track for resolving what has gone wrong with your solution.

  • How to Reboot Machine While Connected Through Remote Desktop

    Came across a bit of an issue today whilst installing multiple machines over remote desktop from windows 7. If you’re on a windows 7 machine then the restart option is removed from the start menu shutdown list. But never fear, Sean’s stuff is here…

    http://stuff.seans.com/2009/01/17/how-to-reboot-machine-while-connected-through-remote-desktop/

    Here’s the magic command (Windows 7, Vista or Windows XP):
     
    shutdown -t 0 -r -f
     
    That’s a “zero” after the -t option, indicating shutdown in zero seconds.  The -r option indicates a restart, rather than shutdown.  (Don’t forget this one)!  The -f option forces all applications to terminate.

    ---

    Ronald has kindly just pointed out that you can also hit the keyboard shortcut of Ctrl+Alt+End and then shutdown / hibernate from there too

  • Handbrake settings for video conversion to HTC Touch HD phone

    I find that these settings work best for http://handbrake.fr/downloads.php for my HTC Touch HD phone.

    Set picture size to Width 480 and Height 288

    image

    Set Video to MPEG-4(FFmpeg), and Target size (MB) to 800

    image

  • Inbox repair tool

    Had great success repairing my inbox the other day. Found an article on the web that pointed me in the direction of this nifty little tool for MS Office 2010 inboxes.

    C:\Program Files (x86)\Microsoft Office\Office14\SCANPST.EXE

    image

  • Microsoft Tech Days

    Online events and recordings of previous events can be found here…

    http://uktechdays.cloudapp.net/home.aspx

  • ElementHost rendering issues with the Windows Aero theme enabled

    Came across this issue on the project I’ve been working on. When resizing a form that contained the System.Windows.Forms.Integration.ElementHost control to host WPF content inside a Windows Forms control, we noticed that the new screen real estate inside the ElementHost was not redrawn at all. Rather it just left a black border around the original sized control. Turns out the fix listed in this post resolves the issue for Windows 7 users.

    http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/a8a5eebc-3d9e-44bb-abe3-8ce0d4e48263/?ffpr=0

    I noticed it wasn’t affecting the windows XP end users, only the developers that had upgraded to Windows 7 with the Aero features enabled…

  • Problems installing Windows 7 Service pack 1

    Thought I'd let you know how I managed to get the Windows 7 SP1 to finally install (it takes a while).

    At first I had little luck, as it kept saying it was unable to install, and I was receiving this message

    clip_image002[4]

    So then went online to find out how to fix this, and it told me to rund the following troubleshooter to fix problems with windows update here… (Start, Troubleshooting, Fix problems with windows update)

    clip_image001

    Which fixed two problems that it found with windows update…

    clip_image002

    And then after a couple of restarts and about 45 mins waiting around, finally it installed successfully…

    clip_image003

  • Virtualization in WPF with VirtualizingStackPanel

    Finally managed to figure out how to get virtualization to actually behave itself in a listbox wpf control.

    Turns out that in order for Virtualization to work, you need three things satisfied. 

    1) Use a control that supports virtualization (e.g. list box or list view). (see Controls That Implement Performance Features section at bottom of this page for more info http://msdn.microsoft.com/en-us/library/cc716879.aspx#Controls )

    2) Ensure that the ScrollViewer.CanContentScroll attached property is set to True on the containing list box / list view control.

    3) Ensure that either the list box has a height set, or that it is contained within a parent Grid row, where that row definition has a height set (Height="*" will do if you want it to occupy the Client window height). Note: Do not use height=”Auto” as this will not work, as this instructs WPF to simply size the row to the height needed to fit all the items of the list box in, hence you do not get the vertical scroll bar appearing.

    4) Ensure that there is no wrapping ScrollViewer control around the list box, as this will prevent virtualization from occuring.

  • Not able to bind to Uid or Name property in XAML

     

    Even though x:Name is a dependency property for a WPF framework element, you cannot the name of the control to a static resource in the code behind file

     

    <Window x:Class="WpfApplication2.Window1"

            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

            xmlns:local="clr-namespace:WpfApplication2"

            Title="Window1"

            Height="300"

            Width="300">

        <Grid>

            <Grid.CommandBindings>

                <CommandBinding Command="local:AppCommands.Find"

                                CanExecute="CanFind"

                                Executed="CommandBinding_OnExecuted"/>

            </Grid.CommandBindings>

            <StackPanel>

                <TextBox Name="textBox1"/>

                <Button Command="local:AppCommands.Find"

                        Name="{x:Static local:Window1.MyControlName}"/>

            </StackPanel>

        </Grid>           

    </Window>

     

     

    namespace WpfApplication2

    {

        /// <summary>

        /// Interaction logic for Window1.xaml

        /// </summary>

        public partial class Window1 : Window

        {

     

            public static readonly string MyControlName = "name";

     

    Gives this compilation error

     

    c:\Dev\.NET\WpfApplication2\WpfApplication2\Window1.xaml(17,21): error MC3079: MarkupExtensions are not allowed for Uid or Name property values, so '{x:Static local:Window1.MyControlName}' is not valid. Line 17 Position 21.

     

This Blog

Syndication

News

Powered by Community Server (Personal Edition), by Telligent Systems