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] crashes for csproj that use Windows-1252 encoding #47

Open
Mattwmaster58 opened this issue Dec 11, 2024 · 1 comment · May be fixed by #48
Open

[BUG] crashes for csproj that use Windows-1252 encoding #47

Mattwmaster58 opened this issue Dec 11, 2024 · 1 comment · May be fixed by #48
Labels
bug Something isn't working

Comments

@Mattwmaster58
Copy link

Mattwmaster58 commented Dec 11, 2024

Describe the bug
If the XML encoding is set to Windows-1252, the program will crash with the following traceback:

System.Xml.XmlException:System does not support 'Windows-1252' encoding. Line 1, position 31.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args, Exception innerException)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Exception innerException)
   at System.Xml.XmlTextReaderImpl.CheckEncoding(String newEncodingName)
   at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
   at System.Xml.XmlTextReaderImpl.Read()
   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() 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.<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 15
-----Inner Exception----
System.ArgumentException:'Windows-1252' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. (Parameter 'name')
   at System.Text.EncodingTable.InternalGetCodePageFromName(String name)
   at System.Text.EncodingTable.GetCodePageFromName(String name)
   at System.Text.Encoding.GetEncoding(String name)
   at System.Xml.XmlTextReaderImpl.CheckEncoding(String newEncodingName)

To Reproduce
In a .csproj:

<?xml version="1.0" encoding="Windows-1252"?>

(rest does not matter).
Run Dependensee <path>

Example VS Solution
N/A

DependenSee Command
Dependensee <path>

DependenSee Output
N/A

DependenSee Version
Package Id Version Commands

dependensee 2.2.0 DependenSee

@Mattwmaster58 Mattwmaster58 added the bug Something isn't working label Dec 11, 2024
@Mattwmaster58
Copy link
Author

related that I could probably just copy from: https://github.com/NuKeeperDotNet/NuKeeper/pull/366/files

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

Successfully merging a pull request may close this issue.

1 participant