You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure you have at least two DLL's where one of them has a dependency on the other (i.e. First.dll depends on Second.dll)
Using CLI in terminal, execute command: ilspycmd First.dll Second.dll -p -o TEMP
Open the newly generated solution in VS from the TEMP directory
Notice in project First how the reference to Second is a DLL reference, NOT a project reference.
Expectation
First should see Second as a project reference
Details
The main culprit of this issue is in ICSharpCode.Decompiler.Solution.SolutionCreator with the use of ProjectFileNamespace which is coded for how this would work with the old project file structure.
Since the new SDK style is used by default (from CLI or UI), our only option is to manually correct this after decompilation, which is a ton of work. From some quick testing, simply using string.Empty in replace of the XML namespace works just fine for the expected behavior to work. However, the correct solution would probably involve finding a way to pull in ICSharpCode.Decompiler.DecompilerSettings into SolutionCreator somehow so that we can reference the UseSdkStyleProjectFormat boolean.
...which seems to be referenced in two different areas: ICSharpCode.ILSpyCmd.ILSpyCmdProgram.OnExecute & ICSharpCode.ILSpy.SolutionWriter.CreateSolution.
Steps to reproduce
First.dll
depends onSecond.dll
)ilspycmd First.dll Second.dll -p -o TEMP
TEMP
directoryFirst
how the reference toSecond
is a DLL reference, NOT a project reference.Expectation
First
should seeSecond
as a project referenceDetails
The main culprit of this issue is in
ICSharpCode.Decompiler.Solution.SolutionCreator
with the use ofProjectFileNamespace
which is coded for how this would work with the old project file structure.ILSpy/ICSharpCode.Decompiler/Solution/SolutionCreator.cs
Line 32 in 94982b5
ILSpy/ICSharpCode.Decompiler/Solution/SolutionCreator.cs
Lines 163 to 165 in 94982b5
ILSpy/ICSharpCode.Decompiler/Solution/SolutionCreator.cs
Lines 176 to 193 in 94982b5
Since the new SDK style is used by default (from CLI or UI), our only option is to manually correct this after decompilation, which is a ton of work. From some quick testing, simply using
string.Empty
in replace of the XML namespace works just fine for the expected behavior to work. However, the correct solution would probably involve finding a way to pull inICSharpCode.Decompiler.DecompilerSettings
intoSolutionCreator
somehow so that we can reference theUseSdkStyleProjectFormat
boolean.ILSpy/ICSharpCode.Decompiler/DecompilerSettings.cs
Line 1868 in 94982b5
The only public method of that class is one of the
WriteSolutionFile
overloads...ILSpy/ICSharpCode.Decompiler/Solution/SolutionCreator.cs
Line 43 in 94982b5
...which seems to be referenced in two different areas:
ICSharpCode.ILSpyCmd.ILSpyCmdProgram.OnExecute
&ICSharpCode.ILSpy.SolutionWriter.CreateSolution
.ILSpy/ICSharpCode.ILSpyCmd/IlspyCmdProgram.cs
Line 137 in 94982b5
ILSpy/ILSpy/SolutionWriter.cs
Line 124 in 94982b5
Workaround
The text was updated successfully, but these errors were encountered: