Couple of bugs #2
Replies: 1 comment 1 reply
-
Most of this was handled via email, but I'll detail what I've determined here. For the first error, this is caused by a DSP that contains a file that is clearly not a source file (it ended in .ppf and the contents appeared to be some sort of packaging file from the VS6 era) but was followed by a block that tried to claim it was excluded from the build, which meant that the list of current compile files was empty and thus lead to the exception. As such, I have opted not to adopt the proposed fix, as it is being caused by a vastly erroneous situation. For the second error, this is caused by a Custom Build Step that was not in a format that I expected (but should've probably taken into account, as I did have examples of it). I did implement the proposed fix to combat that. But I will acknowledge that there may be aspects of the Custom Build Step that my code is probably not translating to VCXPROJ correctly, mainly if the step contains custom variables. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
C:_repo1\DSPtoVCXPROJ-main\bin\Debug\net7.0>DSPtoVCXPROJ.exe C:_repo1\KMAgentsMT\ClientAgent\src\KmClientEntry\KMClientEntry.dsp
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at DSPtoVCXPROJ.MultipleClCompile.set_ExcludedFromBuild(Nullable`1 value) in C:_repo1\DSPtoVCXPROJ-main\MultipleClCompile.cs:line 15
at DSPtoVCXPROJ.Program.ProcessProps(String line, Int32 lineNumber) in C:_repo1\DSPtoVCXPROJ-main\Program.cs:line 321
at DSPtoVCXPROJ.Program.Main(String[] args) in C:_repo1\DSPtoVCXPROJ-main\Program.cs:line 1541
In MultipleCLCompile.cs
10 public bool? ExcludedFromBuild
11 {
12 set
13 {
14 foreach (var obj in this.Objects)
15 if (obj != null) <======= Had to add this
16 obj.ExcludedFromBuild = value;
17 }
18 }
C:_repo1\DSPtoVCXPROJ-main\bin\Debug\net7.0>DSPtoVCXPROJ.exe C:_repo1\HSMAcessService\HSMASMSG\HSMASMSG.dsp
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.String.get_Chars(Int32 index)
at DSPtoVCXPROJ.Program.Main(String[] args) in C:_repo1\DSPtoVCXPROJ-main\Program.cs:line 1602
In Program.cs
1598 case var _ when processsCustomBuild:
1599 {
1600 // Process the actual Custom Build Step, the line without a tab is the one that contains the output filename
1601 int colon = line.IndexOf(" : ");
1602 if (colon > 0) <====== Added this check for no colon
1603 {
1604 if (line[colon - 1] == '"')
1605 --colon;
1606 Program.currentConfig!.Properties.CustomBuildStep.Outputs = line[1..colon];
1607 }
1608 break;
1609 }
HSMASMSG.dsp
Beta Was this translation helpful? Give feedback.
All reactions