Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8718297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:30:31+00:00 2026-06-13T06:30:31+00:00

I’m trying to use the Graph# libraries in my VSPackage project, but unfortunately there

  • 0

I’m trying to use the Graph# libraries in my VSPackage project, but unfortunately there are some obstacles to conquer. Here is what I did:

I copied all the following DLL’s to a folder /Libraries in the project root:

  • GraphSharp.dll
  • GraphSharp.Controls.dll
  • QuickGraph.dll
  • WPFExtensions.dll

The Build Action of all is ‘Content’ and the option Copy to Output is set to ‘Do not copy’.

I added those references to my project. (Add Reference… -> Browse -> select them from the /Library folder)

After that, I created the following files. You can see that the ViewModel is set to be the DataContext of the UserControl and that it defines a “MethodGraph” to which the UI binds.

XAML file

<UserControl x:Class="Biocoder.InteractiveExploration.View.ExplorationControl"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:graphsharp="clr-namespace:GraphSharp.Controls;assembly=GraphSharp.Controls"
         mc:Ignorable="d" 
         d:DesignHeight="300" d:DesignWidth="300">

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>

    <ListView Grid.Row="0" ItemsSource="{Binding SelectedMethods}">
        <ListView.View>
            <GridView>
                <GridViewColumn Header="Method" DisplayMemberBinding="{Binding Name}"/>
                <GridViewColumn Header="ReturnType" DisplayMemberBinding="{Binding ReflectionInfo.ReturnType}"/>
                <GridViewColumn Header="Incoming Calls"/>
                <GridViewColumn Header="Outgoing Calls"/>
            </GridView>
        </ListView.View>
    </ListView>

    <graphsharp:GraphLayout Graph="{Binding MethodGraph}"/>

</Grid>

</UserControl>

Code-behind

public partial class ExplorationControl : UserControl
{
    public ExplorationControl()
    {
        InitializeComponent();

        // set the datacontext
        DataContext = InteractiveExplorationPackage.ExplorationToolViewModel;
    }
}

ViewModel

public class ExplorationToolViewModel : ViewModelBase
{
    private IBidirectionalGraph<object, IEdge<object>> _methodGraph;

    public IBidirectionalGraph<object, IEdge<object>> MethodGraph
    {
        get { return _methodGraph; }
        set
        {
            if (value != _methodGraph)
            {
                _methodGraph = value;
                NotifyPropertyChanged("MethodGraph");
            }
        }
    }

    public ExplorationToolViewModel()
    {
        InitializeViewModel();
    }

    private void InitializeViewModel()
    {
        SelectedMethods = new ObservableCollection<Method>();
        CreateGraph();
    }

    private void CreateGraph()
    {
        var g = new BidirectionalGraph<object, IEdge<object>>();

        // add vertices
        string[] vertices = new string[5];
        for (int i = 0; i < 5; i++)
        {
            vertices[i] = i.ToString();
            g.AddVertex(vertices[i]);
        }

        // add edges
        g.AddEdge(new Edge<object>(vertices[0], vertices[1]));
        g.AddEdge(new Edge<object>(vertices[1], vertices[2]));
        g.AddEdge(new Edge<object>(vertices[2], vertices[3]));
        g.AddEdge(new Edge<object>(vertices[3], vertices[1]));
        g.AddEdge(new Edge<object>(vertices[1], vertices[4]));

        MethodGraph = g;
    }
}

Fortunately, I can compile the whole project but at runtime the following error in the XAML occurs on the tag (right above the needed tag):

Could not load file or assembly ‘GraphSharp.Controls, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file.

But I referenced the assemblies, they are listed in the references list.
What’s the problem? Could it be that assemblies have to be referenced another way round than usual when writing a Visual Studio Package (plugin)?

EDIT: I just tried to get it work in another project, so I just set up a normal WPF Application and did all the above. In this solution everything works properly! That’s so strange!

Hope you can help me 🙂
Best regards!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:30:33+00:00Added an answer on June 13, 2026 at 6:30 am

    I managed to get everything working now. Thanks for your help anyway!

    The problem with VSPackages at runtime is basically that they load third party assemblies from another location on the computer called the Private Assembly folder. (C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies) So all you have to do is to copy the referenced assemblies into this folder (requires admin rights). In order to be able to use the assemblies when developing just add those references to your project as you do normally and the compiler will use them the usual way. The only difference is at runtime since Visual Studio loads those references from the Private Assemblies folder.

    More information about this can be found here: Managed VSPackage File Location Keys

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.