 |
|
 |
I added it as an external tool in VS2008 and ran it, but it crashed with a FileNotFoundException looking for EnvDTE. Do you have a newer version?
|
|
|
|
 |
|
 |
I've created a simular tool, without relying on the DTE-API that is not available in the express editions.
(works for both C# and C++ projects)
It is available
[here].
|
|
|
|
 |
|
 |
This crashes on my solution (not too large - about 10k source lines / ~100 files).
GraphViz process 'dot.exe' just keeps eating memory until it crashes (reached 2.4 gig mem).
|
|
|
|
 |
|
 |
Graphviz (dot.exe) has some format limitations which may be hit by standard project names.
When name an object or linking 2 objects together in the graph, you can't have space, minus, period in the value.
ie.
EnvDTE.BuildDependency bd = dte.Solution.SolutionBuild.BuildDependencies.Item(i);
string prjName = bd.Project.Name.Replace('-', '_').Replace('.', '_').Replace(' ', '_');
if(isExclude(prjName)){
dFile.WriteLine(prjName + " [shape=box,style=filled,color=hotpink1];" ); }else{
dFile.WriteLine(prjName + " [shape=box,style=filled,color=olivedrab1];" ); }
IEnumerable depPrj = (IEnumerable)bd.RequiredProjects;
foreach (Project item in depPrj)
{
string linkPrjName = item.Name.Replace('-', '_').Replace('.', '_').Replace(' ', '_');
if (!isExclude(linkPrjName))
{ dFile.WriteLine(linkPrjName + " -> " + prjName);
}
}
And don't forget the exclude file names
_exclNames.Add(excl.Replace('-', '_').Replace('.', '_')).Replace(' ', '_');
|
|
|
|
 |
|
 |
I compiled the project and it seems to run mostly OK (after downloading/compiling the KingsTools project) but all project names end up as little squares - as if they were invalid characters.
Is there a newer version of the project somewhere?
|
|
|
|
 |
|
 |
Could you please provide an example, coz I seems do not clear understand what you mean...
On what version of VS do you try it?
BTW: For what reason do you need KingTools? This tool do not has any relations to KingTools...
|
|
|
|
 |
|
 |
I've done some changes to make it working in VS 2008.
1.Changed variable for VS version(TODO: put it to config or command-line parameter)
string sDTEName = "VisualStudio.DTE.9.0";
try
{
dte = (EnvDTE.DTE)System.Runtime.InteropServices.Marshal.GetActiveObject(sDTEName);
}
2. Store output file as variable to open the image after it was created and specify full path for dot.exe:
string sNewFile=dir + slnName + "_dep.png";
string cmdLine = " -Tpng " + dFileName + " -o " + sNewFile;
string sPath=@"C:\Program Files\Graphviz 2.21\bin\"+"dot.exe";
proc.StartInfo.FileName = sPath;
proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = sNewFile;
proc.Start();
3. Do NOT delete text file, because it can be useful
//File.Delete(dFileName);
Unfortunately the utility didn't help me, because it created only 2 levels of hierarchy for my huge solution.
Also for project with . in the name(e.g. MyCompany.DataLayer.MyProject.csproj) it draw each part of the name as separate white box.
Note: that utility crashes with some COM error, if the solution runs in debugger.
Michael Freidgeim.
Blog: http://geekswithblogs.net/mnf/
|
|
|
|
 |
|
 |
To run this with your version of msdev, update the DepGraphClass.cs line 39 with the following values:
# For Visual Studio .NET 2002: "VisualStudio.DTE.7"
# For Visual Studio .NET 2003: "VisualStudio.DTE.7.1"
# For Visual Studio 2005: "VisualStudio.DTE.8.0"
|
|
|
|
 |
|
|
 |
|
 |
I would love to see the output in SVG (vector graphics writtin in xml). Then you would not have the problem with too big pix with large projects und you could easily zoom in or out. I made the experience with png, that it does not contain real vector graphics, it just kinda emulates them and you can see the pixels if you zoom in.
You can view SVG graphics in Internet Explorer with a plug-in from Adobe -> in an ASP.NET project, you could even look at the dependecies of the application in the same application just linking to the SVG file.
|
|
|
|
 |
|
 |
There is no commandline to do it (yet?), but if you pull down the code you can output SVG by changing the commandline for dot.exe
Currently used is -Tpng
you can change this to -T canon cmap cmapx cmapx_np dot eps fig gd gd2 gif gv imap imap_np ismap jpe jpeg jpg pdf plain plain-ext png ps ps2 svg svgz tk vml vmlz vrml wbmp xdot
You can also change the form of the graph implied default is -Kdot
you can change this to -K circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
run "dot.exe -v?" and see what options you have
|
|
|
|
 |
|
 |
exception: missing executable dot.exe! whatever this exe should be, i have it not.
|
|
|
|
 |
|
 |
ok. found it. it was always an advantage if you can read....
|
|
|
|
 |
|
 |
You could have implemented it via the Netron graph library. Just an idea, nice idea code and anyway!
|
|
|
|
 |
|
 |
hi Francois ... i was just thinking the same. I only picked up Netron a few weeks ago and have been playing with it. How hard do you think it would be to impliment your suggestion. Id like to do it; any pointers before i get started?
|
|
|
|
 |
|
 |
Depends on what you wanna do.
A graphical assembly dependency walker is not available as far as I know. Bit more tricky than a class visualizer I beleive. If you wanna go that way I think it would be a good idea to develop a plugin for Lutz Roeder's highly popular reflector[^]
Inside Visual Studio 2005 you have a very decent class-designer, Netron cannot compete with. Howard van Rooijen[^] implemented (together with a bit of help from me) a debugger visualizer for VS2005beta.
For VS2003 or as an independent tool see the latest blog shots[^] on the Netron site. I have implemented a shape with all you need to reflect namespaces and types, to be released together with version 2.2 of the graphcontrol.
If you need more help or ideas, let me know...
|
|
|
|
 |
|
 |
hi Francois, I thought it woudnt be fair to hijack this thread with a discussion that wasnt related directly to the Project dependency graph generator, and so i emailed you more details of what i had in mind.
iLFiS nice work with this article I like it.
|
|
|
|
 |
|
 |
What's up with 2 posts. Another is at:
http://www.codeproject.com/useritems/depgraph.asp
By the way it crashed at:
proc.Start();
cmdLine is:
-Tpng C:\My Company Projects\My Company Projects Dev\dep.txt -o C:\My Company Projects\My Company Projects Dev\InternetApplication.Presentation.Web.Reports_dep.png
|
|
|
|
 |
|
|
 |
|
 |
It is expecting "dot.exe" and some other exectuables which isn't included in the source distribution. One place you can get these is from the KingsTools project.
|
|
|
|
 |
|
 |
this works quite well, but you have a problem with filenames with spaces in, the addition of a few "" here and there makes it work.
|
|
|
|
 |