File tree Expand file tree Collapse file tree 1 file changed +19
-19
lines changed
source/MetadataProcessor.Core/Utility Expand file tree Collapse file tree 1 file changed +19
-19
lines changed Original file line number Diff line number Diff line change 1212namespace nanoFramework . Tools . MetadataProcessor
1313{
1414 /// <summary>
15- /// Implements special external .NET nanoFramework assemblies resolution logic.
16- /// MetadataTransformer gets maps with pair assembly name and assebly path in command line,
17- /// if we unable to load assemlby using default resolver we will try to use this map.
15+ /// Need to use .NET nanoFramework assemblies for resolution.
16+ /// When calling MDP it's required to provide load hints with pairs of assembly name and assebly path.
1817 /// </summary>
1918 public sealed class LoadHintsAssemblyResolver : BaseAssemblyResolver
2019 {
@@ -38,38 +37,39 @@ public override AssemblyDefinition Resolve(AssemblyNameReference name)
3837 {
3938 try
4039 {
41- return base . Resolve ( name ) ;
42- }
43- catch ( Exception )
44- {
45- string assemblyFileName ;
46- if ( _loadHints . TryGetValue ( name . Name , out assemblyFileName ) )
40+ if ( _loadHints . TryGetValue ( name . Name , out string assemblyFileName ) )
4741 {
4842 return AssemblyDefinition . ReadAssembly ( assemblyFileName ) ;
4943 }
50-
44+ else
45+ {
46+ return null ;
47+ }
48+ }
49+ catch ( Exception )
50+ {
5151 throw ;
5252 }
5353 }
54-
5554
5655 /// <inheritdoc/>
5756 public override AssemblyDefinition Resolve ( AssemblyNameReference name , ReaderParameters parameters )
5857 {
5958 try
6059 {
61- return base . Resolve ( name , parameters ) ;
62- }
63- catch ( Exception )
64- {
65- string assemblyFileName ;
66- if ( _loadHints . TryGetValue ( new AssemblyName ( name . FullName ) . Name , out assemblyFileName ) )
60+ if ( _loadHints . TryGetValue ( new AssemblyName ( name . FullName ) . Name , out string assemblyFileName ) )
6761 {
6862 return AssemblyDefinition . ReadAssembly ( assemblyFileName ) ;
6963 }
70-
64+ else
65+ {
66+ return null ;
67+ }
68+ }
69+ catch ( Exception )
70+ {
7171 throw ;
7272 }
7373 }
7474 }
75- }
75+ }
You can’t perform that action at this time.
0 commit comments