madushans / dependensee Goto Github PK
View Code? Open in Web Editor NEWDotnet project and package dependency visualizer.
License: MIT License
Dotnet project and package dependency visualizer.
License: MIT License
tried with sample .net 5.0 project, added newtonsoft.json as dependency, built but
PS C:\git\.Azure> DependenSee.exe -s .\ConsoleApp\ -t consolejson -IncludePackages
does
{
"Projects": [
{
"Id": "ConsoleApp\\ConsoleApp.csproj",
"Name": "ConsoleApp"
},
{
"Id": "ConsoleApp.Tests\\ConsoleApp.Tests.csproj",
"Name": "ConsoleApp.Tests"
}
],
"Packages": [],
"References": []
}
If I use:
DependenSee "<Inputpath>" "<outputpath>"
in PowerShell, I always get the following Error.
Error:
UnauthorizedAccessException:Access to the path 'D:....' is denied.
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
I've tried everything.
with PowerShell with admin privileges:
different output paths
users\documents as output path
different input paths with different projects
I've even build the solution myself with manifest and requestedExecutionLevel level="requireAdministrator"
It seems that i cant get DependenSee to get the privileges to create a file
This is a pretty simple request and I'm happy to submit a PR for it but wanted to talk to you about how best to go about it.
I would like to be able to specify the title used in HTML output from the command line. I'm currently going through a lot of projects trying to find dependencies and sometimes end up with multiple DependenSee HTML browser windows open and it would be helpful to be able to tell them apart more easily.
An option could be added such as -HT
or -HtmlTitle
where it defaults to "DependenSee" (current behavior) if not specified. The option could be ignored for mismatched output types, a warning displayed but output still generated, or an error + abort triggered.
My approach would be to add new constants in ResultWriter.cs
for HtmlTitleToken
and HtmlTitleDefault
and then make the necessary updates in PowerArgsProgram.cs
, Program.cs
, ResultWriter.Write
, and ResultWriter.WriteAsHtmlToFile
to support passing the value through and applying it. The value would be appropriately escaped before being injected into the HTML output.
I also considered using something like AngleSharp to make the update since it's HTML but that seems like overkill as long as the value is being escaped properly.
I don't intend to modify XML, JSON, or GraphViz output as I am less familiar with their use cases and wouldn't want to make changes that could break anyone else's workflow.
I look forward to hearing your thoughts on this.
It would be nice to generate diagrams that exclude folders/projects with a given wildcard parameter, such as:
**/*.Tests
**/*.Tests.csproj
This would enable a much simpler and cleaner view in repositories where the test projects live next to their implementations, rather than in a separate tests
folder with a different project root.
I was excited to find this tool - it is quite helpful. Thanks for making it.
Is your feature request related to a problem? Please describe.
In a large workspace with many projects, what I see is many blue nodes and blue edges. When I click on a node, it and its edges are made bold. Although very useful, it's hard to use.
Describe the solution you'd like
It would be nice to have a way to isolate a node. Some ideas when clicking a node:
Hope you'll consider it, and thank you!
Is your feature request related to a problem?
No
Describe the solution you'd like
I have some .dll
s in a seperate project in my solution. When I reference these .dll
s in my .csproj
filde dependensee should show them in the dependency graph.
Describe alternatives you've considered
None
Additional context
For example Zenject does not offer a nuget-package so one has to download Zenject as .dll
s and reference them in you project themself. DependenSee is not able to detect such a dependency. It looks like this in my .csproj
-file:
...
<Reference Include="Zenject, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\Zenject\Zenject.dll</HintPath>
</Reference>
...
Hey there,
Our .NET source code repository contains some front-end codes as well coming with pnpm package management which tends to use NTFS junction points to avoid node_modules folders. This causes the DependenSee discovery to fail when it hits a junction point.
Directory of $SOURCE\node_modules\.pnpm\@[email protected]\node_modules\@babel
2022-04-01 09:11 AM <DIR> .
2022-04-01 09:11 AM <DIR> ..
2022-04-01 09:11 AM <JUNCTION> parser [$SOURCE\node_modules\.pnpm\@[email protected]\node_modules\@babel\parser]
0 File(s) 0 bytes
DependenSee Command
DependenSee . -P -O outputPath
DependenSee Output
System.IO.DirectoryNotFoundException:Could not find a part of the path '$SOURCE\node_modules\.pnpm\@[email protected]\node_modules\@babel\parser'.
at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
at System.IO.Enumeration.FileSystemEnumerator`1.Init()
at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)
at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
at DependenSee.ReferenceDiscoveryService.Discover(String folder, DiscoveryResult result) in D:\a\1\s\DependenSee\ReferenceDiscoveryService.cs:line 61
at DependenSee.ReferenceDiscoveryService.Discover(String folder, DiscoveryResult result) in D:\a\1\s\DependenSee\ReferenceDiscoveryService.cs:line 119
at DependenSee.ReferenceDiscoveryService.Discover(String folder, DiscoveryResult result) in D:\a\1\s\DependenSee\ReferenceDiscoveryService.cs:line 119
at DependenSee.ReferenceDiscoveryService.Discover(String folder, DiscoveryResult result) in D:\a\1\s\DependenSee\ReferenceDiscoveryService.cs:line 119
at DependenSee.ReferenceDiscoveryService.Discover(String folder, DiscoveryResult result) in D:\a\1\s\DependenSee\ReferenceDiscoveryService.cs:line 119
at DependenSee.ReferenceDiscoveryService.Discover(String folder, DiscoveryResult result) in D:\a\1\s\DependenSee\ReferenceDiscoveryService.cs:line 119
at DependenSee.ReferenceDiscoveryService.Discover(String folder, DiscoveryResult result) in D:\a\1\s\DependenSee\ReferenceDiscoveryService.cs:line 119
at DependenSee.ReferenceDiscoveryService.Discover() in D:\a\1\s\DependenSee\ReferenceDiscoveryService.cs:line 48
at DependenSee.PowerArgsProgram.Main() in D:\a\1\s\DependenSee\PowerArgsProgram.cs:line 91
--- End of stack trace from previous location ---
at PowerArgs.ObjectEx.InvokeMainMethod(Object o)
at PowerArgs.Args.<>c__DisplayClass15_1.<InvokeMain>b__1()
at PowerArgs.Args.Execute[T](Func`1 argsProcessingCode)
at PowerArgs.Args.<>c__DisplayClass15_0.<InvokeMain>b__0(String[] a)
at PowerArgs.REPL.DriveREPL[T](TabCompletion t, Func`2 eval, String[] args, Func`1 defaultEval)
at PowerArgs.Args.InvokeMain(CommandLineArgumentsDefinition definition, String[] args)
at PowerArgs.Args.InvokeMain[T](String[] args)
at DependenSee.Program.Main(String[] args) in D:\a\1\s\DependenSee\Program.cs:line 19
DependenSee Version
2.1.0
To reproduce: generate a HTML DependenSee for https://github.com/devpro/withywoods
^ not sure why nodes are duplicated like above.
Hey there,
To me the most powerful feature of DependenSee is that it can include external Nuget packages.
However, Nuget packages can depend on other packages as well, so it would be nice to see them. Because sometimes those are more important than the topmost packages a given project references. And without that recursiveness the ExcludePackageNamespaces feature doesn't seem very useful to me, tbh.
For example, it could be crucial to show that if your solution depends on Microsoft.Azure.Cosmos, it's going to depend on Newtonsoft.Json as well.
And because of various reasons the package versions should be named as well, just as you can see on the image above.
Thanks in advance!
@madushans I am willing to create PR if you give me the go ahead.
Is your feature request related to a problem? Please describe.
I use the tool through CI and right now it requires that I have to install the .NET 6 runtime just for this tool (I am using .NET 7 and transitioning to .NET 8).
Describe the solution you'd like
The tool targets newer runtimes.
Describe alternatives you've considered
Install .NET 6 runtime.
First of all, great project, thank you!
One small nitpick: Would you be able to modify the graph layout algorithm to don't make nodes overlap? In a large project with lot of dependencies there's a bit of manual shifting around needed to see the information.
For example, this solution will show this graph by default:
Reported by Reddit user https://www.reddit.com/r/dotnet/comments/16c0bm9/comment/jzm979e/?context=3
Describe the bug
-ExcludeFolders "A, B" == Folder B doesn't get removed because of the space
To Reproduce
Run DependenSee with command -ExcludeFolders "A, B"
Expected, folder B
to be exlcluded
Actual: folder B
is included as DependenSee expects the name to include the space. Users must run -ExcludeFolders "A,B"
instead (no space)
Example VS Solution
DependenSee Command
DependenSee -ExcludeFolders "A, B"
DependenSee Output
N/A
DependenSee Version
2.2.0
Apparently the tool only shows dependencies on the project/nuget level. I'd like to be able to drill into a project to see the class dependencies inside that specific project.
Hey there,
Pull Requests are welcome. If you know how to add the bugfix to code and you're sure it fits well with the scope of DependenSee, feel free to branch off of dev
and put a PR.
This template is here only if you're not sure if it really is a bug, if is in scope or you're not looking to contribute code/not know how to start.
Describe the bug
I got a crash when trying to run the tool
To Reproduce
Steps to reproduce the behavior:
Example VS Solution
If possible attach a zip of a solution directory that exepriences this issue.
DependenSee only looks at csproj files, so you don't have to include your code. But if you do, make sure you Clean your solution to prevent any anti malware software from flagging the upload.
DependenSee Command
dependensee . .\References.html
DependenSee Output
System.Xml.XmlException:Invalid character in the given encoding. Line 413, position 67.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
at System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount)
at System.Xml.XmlTextReaderImpl.ReadData()
at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)
at System.Xml.XmlTextReaderImpl.ParseAttributes()
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at DependenSee.ReferenceDiscoveryService.DiscoverFileReferences(String path) in D:\a\1\s\DependenSee\ReferenceDiscoveryService.cs:line 142
at DependenSee.ReferenceDiscoveryService.Discover(String folder, DiscoveryResult result) in D:\a\1\s\DependenSee\ReferenceDiscoveryService.cs:line 88
at DependenSee.ReferenceDiscoveryService.Discover(String folder, DiscoveryResult result) in D:\a\1\s\DependenSee\ReferenceDiscoveryService.cs:line 135
at DependenSee.ReferenceDiscoveryService.Discover() in D:\a\1\s\DependenSee\ReferenceDiscoveryService.cs:line 44
at DependenSee.PowerArgsProgram.Main() in D:\a\1\s\DependenSee\PowerArgsProgram.cs:line 102
--- End of stack trace from previous location ---
at PowerArgs.ObjectEx.InvokeMainMethod(Object o)
at PowerArgs.Args.<>c__DisplayClass15_1.b__1()
at PowerArgs.Args.Execute[T](Func1 argsProcessingCode) at PowerArgs.Args.<>c__DisplayClass15_0.<InvokeMain>b__0(String[] a) at PowerArgs.REPL.DriveREPL[T](TabCompletion t, Func
2 eval, String[] args, Func`1 defaultEval)
at PowerArgs.Args.InvokeMain(CommandLineArgumentsDefinition definition, String[] args)
at PowerArgs.Args.InvokeMain[T](String[] args)
at DependenSee.Program.Main(String[] args) in D:\a\1\s\DependenSee\Program.cs:line 15
=============================================================
| |
| Well that didn't work. |
| |
| If this keeps happening, |
| - try updating to the latest version with |
| - dotnet tool update DependenSee --global |
| |
| - check current version with |
| - dotnet tool list --global |
| |
| - Please open an issue at |
| - https://www.github.com/madushans/DependenSee |
| |
| ♥ Thank you for your support ♥ |
| |
=============================================================
dotnet tool list --global
to get the installed version detailsdependensee 2.2.0 DependenSee
Is your feature request related to a problem? Please describe.
Currently I'm working on a project where we want to analyse the project dependencies. We would like to integrate this package in our console app so we can further analyse the depency graph of dependence. This not possible because Dependensee is currently only available as a dotnet tool in nugget.
Describe the solution you'd like
It would be nice if we could directly add this package to our project instead of using the tool.
Describe alternatives you've considered
Currently we copied this source code into our project. But we would like to directly reference this project and stay up to date.
When you have a repository folder where multiple solutions are in use, or you have a repository folder where some projects are not being used by the main solution, you get additional and not required projects to investigate for dependencies.
If a command line parameter specifying a list of solution file name, then these solution files could be used to evaluate which projects to analyze for dependencies. If not specified, behavior would be as today.
A command line parameter for using a single solution found in the source folder could trigger the same behavior for the single solution file in the folder. In case multiple solution files are found while this parameter is specified, the run should be aborted and an error reported back (something like "You asked to use a single solution file as root, but multiple solution files are found. Specify solution file as argument or run without this parameter")
Problem
I would like to use a dependency tree diagram in Markdown documentation. GitHub and many other platforms and tools can render Mermaid diagrams out of the box, with no need to convert them into images manually.
Solution I'd like
New output type "Mermaid", such that I can paste it in GitHub Markdown documents or elsewhere.
Alternatives
Mermaid format is different enough from Graphviz DOT to discourage from manual conversion.
I can't find any readymade solution that would convert any DependenSee output to Mermaid diagram format.
I would like to avoid writing and supporting my own converter from DependenSee JSON to Mermaid.
Additional context
GitHub example - code and preview:
```mermaid
graph TD;
A["Foo"]
B["Bar"]
A-->B;
A-->C;
B-->D;
C-->D;
```
graph TD;
A["Foo"]
B["Bar"]
A-->B;
A-->C;
B-->D;
C-->D;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.