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 55//
66
77using System . IO ;
8+ using System . Linq ;
89
910namespace nanoFramework . Tools . MetadataProcessor
1011{
@@ -89,8 +90,20 @@ public void Write(
8990 // keeping this here for now, just for compatibility
9091 writer . WriteUInt32 ( 0 ) ;
9192
93+ var nativeMethdodsCount = _context . MethodDefinitionTable . Items . Count ( method => method . RVA == 0 && ! method . IsAbstract ) ;
94+
9295 // 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+ }
94107
95108 // Native methods offset
96109 writer . WriteUInt32 ( 0xFFFFFFFF ) ;
You can’t perform that action at this time.
0 commit comments