Microsoft Developer Network > Página principal de foros > Visual Studio WPF Designer > Cannot edit WPF application in design view in Visual C# 2008 Express - all tools greyed out
Formular una preguntaFormular una pregunta
 

RespondidaCannot edit WPF application in design view in Visual C# 2008 Express - all tools greyed out

  • jueves, 02 de julio de 2009 22:10k0065126 Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    I have installed Visual C# 2008 Express on my Vista and Win7 RC1 computers.  It appears to work correctly on Vista.

    If I create a WPF Application, or load one supplied with the book 'Microsoft Visual C# 2008 Step by Step' I have a problem on Win7.

    There is no way I can add a control to the form because the tools in the toolbox are all greyed out.  I have ensured that I am clicking the title bar of the form and the Properties window shows System.Windows.Window.  If I edit the Title property that is reflected in what is displayed in the form, and I am able to edit the XAML window below the Form Designer to add controls but the tools are still greyed out.

    I did try a repair install but nothing changed, even when I used Compatablity Mode.  I have also tried uninstalling C# and all other Visual Studio components which installed at the same time and then re-installing C# but that did not solve the problem.  Also I have noticed that the Recent Projects list is still populated with the same programs which were there before I did the uninstall, suggesting that the uninstall was incomplete.

    When I did the re-install using vcssetup.exe I used compatability mode (Vista SP20), and have tried running C# in compatability mode as well.  Neither of this helped.

    Can anyone suggest what the problem is please, and how to overcome it, as I have run out of ideas.

    Viv

Respuestas

Todas las respuestas

  • viernes, 03 de julio de 2009 15:42Frankenspank Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    This is a shot in the dark, but try running

    devenv /setup

    This will reset all the packages to default values as well as reset the toolbox. Also are you running the 32 or 64 bit version of Vista?  You might have to changes the flags in the project file to be sure it is set to compile for the correct platform.

    Frank
  • viernes, 03 de julio de 2009 18:55k0065126 Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    This is a shot in the dark, but try running

    devenv /setup

    This will reset all the packages to default values as well as reset the toolbox. Also are you running the 32 or 64 bit version of Vista?  You might have to changes the flags in the project file to be sure it is set to compile for the correct platform.

    Frank

    Thanks for the suggestion, Frank.

    I have tried running 'devenv /setup', 'devenv/setup' and 'devenv.exe/setup' in Command Prompt as administrator but just get a message that 'devenv' or 'devenv.exe' is not recognized as an internal or external comman, operable program or batch file.  Can you tell me what I am doing wrong?

    Thanks,

    Viv
  • viernes, 03 de julio de 2009 20:13k0065126 Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respondida
    I have now found the answer.  Go to Tools, Choose Toolbox Items..., select the WPF Components tab (not sure if this is necessary), then click the Reset button.  The buttons are no longer greyed out.

    Viv
  • miércoles, 08 de julio de 2009 1:44Mark Wilson-ThomasMSFT, ModeradorMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Glad you have found an answer: this issue can be caused when your toolbox database files become corrupted. Resetting the toolbox as you have discovered often fixes the issue.
    Mark
    Mark Wilson-Thomas - Program Team - WPF & SL Designer for Visual Studio - posts are provided 'as-is'