File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
source/MetadataProcessor.Core Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 5
5
//
6
6
7
7
using System . IO ;
8
+ using System . Linq ;
8
9
9
10
namespace nanoFramework . Tools . MetadataProcessor
10
11
{
@@ -89,8 +90,20 @@ public void Write(
89
90
// keeping this here for now, just for compatibility
90
91
writer . WriteUInt32 ( 0 ) ;
91
92
93
+ var nativeMethdodsCount = _context . MethodDefinitionTable . Items . Count ( method => method . RVA == 0 && ! method . IsAbstract ) ;
94
+
92
95
// native methods CRC32
93
- writer . WriteUInt32 ( _context . NativeMethodsCrc . Current ) ;
96
+ // this is used by other tools to check if the assembly has native implementation
97
+ // (like the deployment provider in the VS extension)
98
+ if ( nativeMethdodsCount > 0 )
99
+ {
100
+ writer . WriteUInt32 ( _context . NativeMethodsCrc . Current ) ;
101
+ }
102
+ else
103
+ {
104
+ // this assembly doesn't have any native methods implemented
105
+ writer . WriteUInt32 ( 0 ) ;
106
+ }
94
107
95
108
// Native methods offset
96
109
writer . WriteUInt32 ( 0xFFFFFFFF ) ;
You can’t perform that action at this time.
0 commit comments