Wouterdek/NodeNetwork

Could not load file or assembly 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

EagerTechnologies opened this issue · 1 comments

Hello,

I altered some code and did a few things, but now I am having these errors while trying to call NetworkView:

Assembly 'System.Reactive' with identity 'System.Reactive, Version=4.3.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263' uses 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

Could not load file or assembly 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

XAML:

<Window x:Class="Editor.VScriptGraphWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Editor"
        xmlns:NodeNetwork="clr-namespace:NodeNetwork.Views;assembly=NodeNetwork"
        xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
        mc:Ignorable="d"
        Title="VScript - Title" Height="720" Width="1280" WindowState="Maximized" Background="#FF1E1E1E">
    <Grid>
        <DockPanel>
            <Menu DockPanel.Dock="Top" Background="White" Height="20">
                <MenuItem Header="File" Height="20" FontSize="13">
                    <MenuItem Header="New"/>
                </MenuItem>
                <MenuItem Header="File" Height="20" FontSize="13">
                    <MenuItem Header="New"/>
                </MenuItem>
                <MenuItem Header="File" Height="20" FontSize="13">
                    <MenuItem Header="New"/>
                </MenuItem>
                <MenuItem Header="File" Height="20" FontSize="13">
                    <MenuItem Header="New"/>
                </MenuItem>
            </Menu>
            <Grid x:Name="ToolbarGrid" DockPanel.Dock="Top" Height="30" Margin="0,3,0,0">
                <Grid HorizontalAlignment="Center" Width="100" Margin="0">
                    <Button HorizontalAlignment="Left" Style="{StaticResource Button}" Width="35" Background="#FF3C3C3C" ToolTip="Play">
                        <Image Source="Assets/Icons/play_28px.png"/>
                    </Button>
                    <Button HorizontalAlignment="Center" Style="{StaticResource Button}" Width="35" Background="#FF3C3C3C" ToolTip="Pause">
                        <Image Source="Assets/Icons/pause_28px.png"/>
                    </Button>
                    <Button HorizontalAlignment="Right" Style="{StaticResource Button}" Width="35" Background="#FF3C3C3C" ToolTip="Step">
                        <Image Source="Assets/Icons/end_28px.png"/>
                    </Button>
                </Grid>
            </Grid>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="3" />
                    <RowDefinition Height="300" />
                </Grid.RowDefinitions>

                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="3" />
                        <ColumnDefinition Width="5*" />
                        <ColumnDefinition Width="3" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>

                    <TabControl x:Name="TopLControl" Background="{x:Null}" BorderThickness="0">
                        <TabItem Header="My VScript" Style="{StaticResource CustomTabControl}" Foreground="White" FontSize="14">
                            <Grid Background="#FF3C3C3C">
                                <TreeView Background="{x:Null}" Foreground="White" BorderBrush="#00828790" >
                                    <TreeViewItem Style="{StaticResource CustomTreeViewItem}" Header="Graphs" Height="Auto" HorizontalAlignment="Stretch" IsExpanded="True">
                                        <TreeViewItem Style="{StaticResource CustomTreeViewItem}" Header="Event Graph" Height="Auto" HorizontalAlignment="Stretch"/>
                                    </TreeViewItem>
                                    <TreeViewItem Style="{StaticResource CustomTreeViewItem}" Header="Functions" Height="Auto" HorizontalAlignment="Stretch" IsExpanded="True"/>
                                    <TreeViewItem Style="{StaticResource CustomTreeViewItem}" Header="Macros" Height="Auto" HorizontalAlignment="Stretch" IsExpanded="True"/>
                                    <TreeViewItem Style="{StaticResource CustomTreeViewItem}" Header="Variables" Height="Auto" HorizontalAlignment="Stretch" IsExpanded="True"/>
                                    <TreeViewItem Style="{StaticResource CustomTreeViewItem}" Header="Event Dispatchers" Height="Auto" HorizontalAlignment="Stretch" IsExpanded="True"/>
                                </TreeView>
                            </Grid>
                        </TabItem>
                    </TabControl>
                    <GridSplitter Grid.Column="1" Width="3" HorizontalAlignment="Stretch" Background="#FF282828" />
                    <TabControl x:Name="TopCControl" Grid.Column="2" Background="{x:Null}" BorderThickness="0">
                        <TabItem Header="Event Graph" Style="{StaticResource CustomTabControl}" Foreground="White" FontSize="14">
                            <Grid Background="#FF3C3C3C">
                                <NodeNetwork:NetworkView x:Name="NodeGraph" />
                                <Label Content="VSCRIPT" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,10,10" FontWeight="Bold" FontSize="60" Foreground="#7F686868"/>
                            </Grid>
                        </TabItem>
                    </TabControl>
                    <GridSplitter Grid.Column="3" Width="3" HorizontalAlignment="Stretch" Background="#FF282828" />
                    <TabControl x:Name="TopRightControl" Grid.Column="4" Background="{x:Null}" BorderThickness="0">
                        <TabItem Header="Details" Style="{StaticResource CustomTabControl}" Foreground="White" FontSize="14">
                            <Grid Background="#FF3C3C3C"/>
                        </TabItem>
                    </TabControl>
                </Grid>
                <GridSplitter Grid.Row="1" Height="3" HorizontalAlignment="Stretch" Background="#FF282828" />
                <Grid Grid.Row="2">
                    <TabControl x:Name="BottomControl" Background="{x:Null}" BorderThickness="0">
                        <TabItem Header="Console" Style="{StaticResource CustomTabControl}" Foreground="White" FontSize="14">
                            <Grid Background="#FF3C3C3C">
                                <ListBox x:Name="ConsoleLog" Background="Transparent" Foreground="White" BorderBrush="{x:Null}"/>
                                <Grid Height="25" VerticalAlignment="Top" HorizontalAlignment="Stretch" Background="#00282828">
                                    <Button x:Name="ClearConsoleButton" Content="Clear" Style="{StaticResource Button}" Height="25" Width="80" HorizontalAlignment="Left" Background="#FF282828" BorderBrush="#00707070" Foreground="White" Margin="1,1,0,0"/>
                                    <Grid x:Name="SearchContainer" Width="350" Height="20" HorizontalAlignment="Right" Margin="0,0,5,0" Background="#FF282828">
                                        <Image Height="16" Width="16" HorizontalAlignment="Left" Margin="5,0,0,0" Source="Assets/Icons/search_18px.png"/>
                                        <TextBox x:Name="SearchBox" Width="325" HorizontalAlignment="Right" BorderBrush="#00ABADB3" Foreground="#FFE4E4E4" Background="{x:Null}"/>
                                    </Grid>
                                </Grid>
                            </Grid>
                        </TabItem>
                    </TabControl>
                </Grid>
            </Grid>
        </DockPanel>
    </Grid>
</Window>

xaml.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using DynamicData;
using NodeNetwork.Toolkit.ValueNode;
using NodeNetwork.ViewModels;

namespace Editor
{
    /// <summary>
    /// Interaction logic for VScriptGraphWindow.xaml
    /// </summary>
    public partial class VScriptGraphWindow : Window
    {
        public VScriptGraphWindow()
        {
            InitializeComponent();

            /*---------------------------------------
                Node Graph Impl
            -----------------------------------------*/

            var Network = new NetworkViewModel();

            var StartNode = new NodeViewModel();
            StartNode.Name = "Start";
            Network.Nodes.Add(StartNode);

            var StartNodeOutput = new ValueNodeOutputViewModel<string>();
            StartNodeOutput.Name = "Exec";
            StartNode.Outputs.Add(StartNodeOutput);

            StartNodeOutput.Value = Observable.Return("Example string");

            var PrintNode = new NodeViewModel();
            PrintNode.Name = "Print";
            Network.Nodes.Add(PrintNode);

            var PrintNodeInput = new ValueNodeInputViewModel<string>();
            PrintNodeInput.Name = "String";
            PrintNode.Inputs.Add(PrintNodeInput);

            PrintNodeInput.ValueChanged.Subscribe(NewValue =>
            {
                ConsoleLog.Foreground = Brushes.Yellow;
                ConsoleLog.Items.Add("[WARNING]: " + NewValue);
            });

            NodeGraph.ViewModel = Network;
        }

    }
}

Does you perhaps know the cause to the issue? This started happening when I read a commit that mentioned adding a grid image to my XAML file and making it move with the nodes and connections and downloaded the source code and built from source to use the dll's from the source in my project instead of from the nuget package manager.

Did you change the target framework? Because the error message reports that the version of System.Runtime it found is too old. The repo should work with .NET framework v4.7.2 or .NET Core 3.1 or newer. Make sure you are using one of those. See this link for how framework versions match up to System.Runtime versions.