Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Crash when running #32

Open
ArvoX opened this issue May 1, 2023 · 2 comments
Open

[BUG] Crash when running #32

ArvoX opened this issue May 1, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@ArvoX
Copy link

ArvoX commented May 1, 2023

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, Func2 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 ♥               |
|                                                           |
=============================================================

DependenSee Version
Run dotnet tool list --global to get the installed version details
Package Id Version Commands

dependensee 2.2.0 DependenSee

@ArvoX ArvoX added the bug Something isn't working label May 1, 2023
@ArvoX ArvoX changed the title [BUG] <Short Description> [BUG] Crash when running May 1, 2023
@madushans
Copy link
Owner

Invalid character in the given encoding. Line 413, position 67.

Looks like it failed to parse one of the project files. Is it possible to find and attach the csproj/vbproj file?

if you have a lot of them, unfortunately have to check one by one, i.e renaming it to have a different extension, then see if the crash still happens.

Alternatively, if you prefer, you can write something yourself that traverses through your folder and try to call
new XmlDocument().Load(filePath) to see which one(s) fail with the same error.

@ArvoX
Copy link
Author

ArvoX commented May 3, 2023

I have now run a simple program that tried to load all of our csproj files an I found some that had som busted encoding. So all you could do is to give a bette error message when parsing fails. It would be very nice to get the name of the file that could not be parsed.

Thanks for the quick reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants