none
exeption in virtualbox

    Question

  • Hi all. 

    I have problem with my app that runs on real PC normaly. But when i tryed to run it on Virtualbox the exeption has been appeared. 
    Here is a message of this exception:

    "'Menu' object cannot be added to 'Grid'. Exception from HRESULT: 0x88980406  Error at object 'System.Windows.Controls.Menu' in markup file 'Viewer;component/windows/mainwindow.xaml'."

    Here code of xaml file:

    --------------------------------------------------------------------------------------------------------------------------------------

    <Window x:Class="Visoft3D.SceneViewer.Windows.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:SceneViewer="clr-namespace:Visoft3D.SceneViewer"
        xmlns:Controls="clr-namespace:Visoft3D.SceneViewer.Controls"
        Title="{DynamicResource mainWindow_Title}" Height="600" Width="800" MinHeight="480" MinWidth="640"
            Background="{DynamicResource MainBackgroundBrush}">
        <Window.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="../Resources/LocalizationDictionary.xaml"/>
                    <ResourceDictionary Source="../Resources/DefaultSkin.xaml"/>
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </Window.Resources>
        <Window.CommandBindings>
            <CommandBinding Command="SceneViewer:App.Open" Executed="OnOpenSceneCommand_Executed"/>
            <CommandBinding Command="SceneViewer:App.Close" Executed="OnCloseSceneCommand_Executed"
                            CanExecute="DependingOnLoadedDocument_CanExecute"/>
            <CommandBinding Command="SceneViewer:App.Exit" Executed="OnExitCommand_Executed"/>
            <CommandBinding Command="SceneViewer:App.SwitchReflection" Executed="OnSwitchReflectionCommandBinding_Executed"
                            CanExecute="DependingOnLoadedDocument_CanExecute"/>
            <!--commented by asking of Ottmar for veritest release
                <CommandBinding Command="SceneViewer:App.SwitchShadows" Executed="OnSwitchShadowsCommandBinding_Executed"
                            CanExecute="DependingOnLoadedDocument_CanExecute"/>-->
            <CommandBinding Command="SceneViewer:App.Properties" Executed="OnPropertiesCommand_Executed"/>
            <CommandBinding Command="SceneViewer:App.ControlPannel" Executed="OnControlPannelCommandBinding_Executed"/>
        </Window.CommandBindings>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Menu x:Name="mainMenu" Grid.ColumnSpan="3">
                <MenuItem  Header="{DynamicResource mainWindow_MainMenu_File}">
                    <MenuItem Command="SceneViewer:App.Open" Header="{DynamicResource mainWindow_MainMenu_File_Open}"/>
                    <MenuItem Command="SceneViewer:App.Close" Header="{DynamicResource mainWindow_MainMenu_File_Close}"/>
                    <Separator/>
                    <MenuItem Command="SceneViewer:App.Exit" Header="{DynamicResource mainWindow_MainMenu_File_Exit}"/>
                </MenuItem>
                <MenuItem Header="{DynamicResource mainWindow_MainMenu_View}">
                    <MenuItem x:Name="menuItemControlPannel" Header="{DynamicResource mainWindow_MainMenu_View_ControlPannel}"
                              Command="SceneViewer:App.ControlPannel"/>
                    <MenuItem x:Name="menuItemNavigationPannel" Header="{DynamicResource mainWindow_MainMenu_View_NavigationPannel}"
                              Click="OnNavigationPannelMenuItem_Click"/>
                    <Separator/>
                    <MenuItem x:Name="menuItemReflection" Command="SceneViewer:App.SwitchReflection"
                              Header="{DynamicResource mainWindow_MainMenu_View_Reflection}"/>
                    <!-- commented by asking of Ottmar for veritest release
                    <MenuItem x:Name="menuItemShadows" Command="SceneViewer:App.SwitchShadows"
                              Header="{DynamicResource mainWindow_MainMenu_View_Shadows}"/>-->
                    <Separator/>
                    <MenuItem x:Name="menuItemWorldBox" Header="World Box" Click="OnWorldBox_Click" IsChecked="True"/>
                    <!--<MenuItem Header="Scale 3D Scene" Click="OnScale3DSceneMenuItem_Click"/>-->
                </MenuItem>
                <MenuItem Header="{DynamicResource mainWindow_MainMenu_Tools}">
                    <MenuItem Header="{DynamicResource mainWindow_MainMenu_Tools_Properties}"
                              Command="SceneViewer:App.Properties"/>
                </MenuItem>
            </Menu>
            <Controls:ViewpointsControl x:Name="viewpintsControl" Grid.Row="1" Width="250" VerticalAlignment="Stretch"/>
            <Border Grid.Row="1" Grid.Column="3" BorderThickness="1" Margin="5"
                    BorderBrush="{DynamicResource ControlBorderBrush}"
                    Background="{DynamicResource ControlBackgroundBrush}">
                <WindowsFormsHost x:Name="wfHost" TabIndex="0"/>
            </Border>
        </Grid>
    </Window>

    --------------------------------------------------------------------------------------------------------------------------------------

    Please anybody help me..
    Tuesday, June 23, 2009 1:01 PM

All replies

  • I had a similar problem: WPF-applications did not work in VirtualBox (no execution and no preview in the designer). At the end the problem was the 3d-acceleration in VirtualBox. When i disabled it in the settings for the virtual windows, everything worked.

    I hope that helps you to solve your problem.
    Sunday, August 30, 2009 5:05 PM