Skip to content

System.IO.IOException: Invalid key specification in .reg, line 3 #2

@Lavshyak

Description

@Lavshyak

In Cklutz.RegFile 1.0.9 nuget.org and in cloned this repository.

using RegFile;

using var reader = new RegFileReader("C:\\CodeProjects\\NET\\RegCSVToReg\\FullReester.reg");
var commands = reader.Read(); //exception
System.IO.IOException: Invalid key specification in C:\CodeProjects\NET\RegCSVToReg\FullReester.reg, line 3
   at RegFile.RegFileExtensions.ParseException(SourceLocation location, String msg)
   at RegFile.RegFileExtensions.SplitIntoHiveAndSubKey(ReadOnlySpan`1 span, SourceLocation sourceLocation)
   at RegFile.RegFileReader.Read()
   at Program.<Main>$(String[] args) in C:\CodeProjects\NET\RegCSVToReg\RegCSVToReg\Program.cs:line 4

first part of FullReester.reg (exported by windows 10 registry editor) (line 3 is [HKEY_LOCAL_MACHINE]):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE]

[HKEY_LOCAL_MACHINE\BCD00000000]

[HKEY_LOCAL_MACHINE\BCD00000000\Description]
"KeyName"="BCD00000000"
"System"=dword:00000001
"TreatAsSystem"=dword:00000001
"GuidCache"=hex:23,1e,b1,3d,97,2b,db,01,0a,27,00,00,10,ec,00,0c,29,13,24,13,76,\
  00,00,00

[HKEY_LOCAL_MACHINE\BCD00000000\Objects]

SplitIntoHiveAndSubKey method tries to split HKEY_LOCAL_MACHINE, but there is no sub key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions