@@ -29,7 +29,6 @@ public NetcodeILPPApplicator(string assemblyPath, string outputPath, string[] re
2929 private string AssemblyName => Path . GetFileNameWithoutExtension ( AssemblyPath ) ;
3030 private string AssemblyFileName => Path . GetFileName ( AssemblyPath ) ;
3131 private string AssemblyDirName => Path . GetDirectoryName ( AssemblyPath ) ! ;
32- private string PdbPath => Path . Combine ( AssemblyDirName , $ "{ AssemblyName } .pdb") ;
3332
3433 public static bool HasNetcodePatchedAttribute ( ICompiledAssembly assembly )
3534 {
@@ -63,6 +62,7 @@ public void ApplyProcesses()
6362 }
6463
6564 var debugSymbolsAreEmbedded = assemblyFromFile . DebugSymbolsAreEmbedded ;
65+ var pdbPath = assemblyFromFile . PortableDebugSymbolsFilePath ;
6666 ICompiledAssembly assembly = assemblyFromFile ;
6767
6868 if ( HasNetcodePatchedAttribute ( assembly ) )
@@ -81,7 +81,7 @@ public void ApplyProcesses()
8181 // remove files with _original.dll and _original.pdb
8282
8383 renameAssemblyPath = Path . Combine ( AssemblyDirName , $ "{ AssemblyName } _original.dll") ;
84- renamePdbPath = Path . Combine ( AssemblyDirName , $ "{ AssemblyName } _original.pdb") ;
84+ renamePdbPath = Path . Combine ( Path . GetDirectoryName ( pdbPath ) ! , $ "{ Path . GetFileNameWithoutExtension ( pdbPath ) } _original.pdb") ;
8585
8686 if ( File . Exists ( renameAssemblyPath ) )
8787 {
@@ -96,8 +96,8 @@ public void ApplyProcesses()
9696 }
9797
9898 File . Move ( AssemblyPath , renameAssemblyPath ) ;
99- if ( ! debugSymbolsAreEmbedded )
100- File . Move ( PdbPath , renamePdbPath ) ;
99+ if ( pdbPath is not null )
100+ File . Move ( pdbPath , renamePdbPath ) ;
101101 }
102102
103103 ICompiledAssembly ApplyProcess < TProcessor > ( ICompiledAssembly assemblyToApplyProcessTo )
@@ -167,10 +167,10 @@ ICompiledAssembly ApplyProcess<TProcessor>(ICompiledAssembly assemblyToApplyProc
167167 File . Move ( renameAssemblyPath ! , AssemblyPath ) ;
168168 }
169169
170- if ( File . Exists ( renamePdbPath ! ) )
170+ if ( pdbPath is not null && File . Exists ( renamePdbPath ! ) )
171171 {
172- if ( File . Exists ( PdbPath ) ) File . Delete ( PdbPath ) ;
173- File . Move ( renamePdbPath ! , PdbPath ) ;
172+ if ( File . Exists ( pdbPath ) ) File . Delete ( pdbPath ) ;
173+ File . Move ( renamePdbPath ! , pdbPath ! ) ;
174174 }
175175 }
176176
0 commit comments