File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ internal sealed partial class AssemblyInfo
3232
3333 /// <summary>
3434 /// The version number of the .NET Core framework that this assembly targets.
35- ///
35+ ///
3636 /// This is extracted from the `TargetFrameworkAttribute` of the assembly, e.g.
3737 /// ```
3838 /// [assembly:TargetFramework(".NETCoreApp,Version=v7.0")]
@@ -165,6 +165,11 @@ public static AssemblyInfo ReadFromFile(string filename)
165165 unsafe
166166 {
167167 var reader = new MetadataReader ( metadata . Pointer , metadata . Length ) ;
168+ if ( ! reader . IsAssembly )
169+ {
170+ throw new AssemblyLoadException ( ) ;
171+ }
172+
168173 var def = reader . GetAssemblyDefinition ( ) ;
169174
170175 // This is how you compute the public key token from the full public key.
Original file line number Diff line number Diff line change @@ -644,9 +644,25 @@ private void AnalyseSolutions(IEnumerable<string> solutions)
644644
645645 public void Dispose ( )
646646 {
647- packageDirectory ? . Dispose ( ) ;
647+ try
648+ {
649+ packageDirectory ? . Dispose ( ) ;
650+ }
651+ catch ( Exception exc )
652+ {
653+ progressMonitor . LogInfo ( "Couldn't delete package directory: " + exc . Message ) ;
654+ }
648655 if ( cleanupTempWorkingDirectory )
649- tempWorkingDirectory ? . Dispose ( ) ;
656+ {
657+ try
658+ {
659+ tempWorkingDirectory ? . Dispose ( ) ;
660+ }
661+ catch ( Exception exc )
662+ {
663+ progressMonitor . LogInfo ( "Couldn't delete temporary working directory: " + exc . Message ) ;
664+ }
665+ }
650666 }
651667 }
652668}
You can’t perform that action at this time.
0 commit comments