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
32
32
33
33
/// <summary>
34
34
/// The version number of the .NET Core framework that this assembly targets.
35
- ///
35
+ ///
36
36
/// This is extracted from the `TargetFrameworkAttribute` of the assembly, e.g.
37
37
/// ```
38
38
/// [assembly:TargetFramework(".NETCoreApp,Version=v7.0")]
@@ -165,6 +165,11 @@ public static AssemblyInfo ReadFromFile(string filename)
165
165
unsafe
166
166
{
167
167
var reader = new MetadataReader ( metadata . Pointer , metadata . Length ) ;
168
+ if ( ! reader . IsAssembly )
169
+ {
170
+ throw new AssemblyLoadException ( ) ;
171
+ }
172
+
168
173
var def = reader . GetAssemblyDefinition ( ) ;
169
174
170
175
// 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)
644
644
645
645
public void Dispose ( )
646
646
{
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
+ }
648
655
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
+ }
650
666
}
651
667
}
652
668
}
You can’t perform that action at this time.
0 commit comments