using Graphviz4net without having the environment variable setup

Jul 27, 2012 at 7:32 AM


I want to build a graph using GraphViz4Net, without having to set the bin folderpath into the Path environment variable. This is because, I do not want to restrict other users to also setup the GraphViz4Net library (its bin folder into Path variable etc).

Currently I have copied the items: dot.exe, graph.dll, gvc.dll, ltdl.dll, Pathplan.dll and zlib1.dll as links to my solution, with copy local option. It still gives me this exception:

"Graphviz4Net: an exception was thrown during layouting. Exception message: Graph in dot output does not have width or height value set up.."

What dll's (or files in general) do I need to include for resolving this issue. I presume it should be some settings or configuration files. 

Thank you for your time.



Jul 27, 2012 at 8:01 AM

Hi Shravan,

I must admit that i don't know what dependencies GraphViz needs. However, it seems that you got it right and the error is about something else. I assume that you are using the WPF component, right? Try setting LogGraphvizOutput = true and examining the log file, it will be created in the folder from which you run your program (probably bin folder) and it will contain the output of GraphViz. One can also use DotExecutablePath property to avoid setting up the PATH environment variable.

Jul 27, 2012 at 8:15 AM
Edited Jul 27, 2012 at 8:19 AM

Hi Steve,

Thank you for your quick response.

Yes, I am using a WPF application. Can you tell me what would be the name of the output log file? And the property: DotExecutablePath is set within DotExeRunner.cs?

Thanks again

Jul 28, 2012 at 10:33 AM

Hi there,

the files should be named "" and "". First one is the input graph generated by GraphViz4Net and the second one is the output of GraphViz itself. They're created in DotRunnerLogDecorator class which wraps DotExeRunner, however, the only thing you need is to set dependency property called LogGraphvizOutput on the GraphLayout WPF component. The DotExecutablePath can be also either set in DotExeRunner, but is also a dependency property available on the GraphLayout WPF component. In other words:

                Graph="{Binding Graph}"
                x:Name="GraphLayout"> ...
I am talking here about the latest version from CVS, not sure if DotExecutablePath is in the latest release version, but building the latest version from source should be fairly simple.

Jul 29, 2012 at 10:07 PM

Thank you for your response. This should help a lot :)