Added a property Resources to IAssembly and IUnresolvedAssembly. #287
Loading…
Reference in a new issue
No description provided.
Delete branch "resources"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This property contains all embedded (/resource csc command line option) and linked (/linkresource option) resources. There is also something known as an "asssembly-linked" resource, but this is not supported because my Google-fu has failed me in finding out what it actually is and how to create one.
As discussed in #133, no resource data is being kept in memory unless the
GetResourceStreammethod is used.You don't need to add the
string fileNameparameter: you can get the full path to the assembly file fromModuleDefinition.FullyQualifiedName.Thanks. I was looking for that, but I just couldn't find it.
For
CSharpProjectContent, I think it's sufficient if you provideAddResource(IAssemblyResource)andRemoveResource(IAssemblyResource)methods. The concrete implementation of the interface in this case can be left to the caller (for example, theGetResourceStreammethod in SharpDevelop might read the resources from an open editor instead of accessing the file system).Also,
AssemblyDefinition.ReadAssemblywill fail for non-primary modules; it's better to useModuleDefinition.ReadModuleRemoved the unnecessary extra fileName parameter (rebased)
OK, I'll wait for all your comments before doing more :)
Should RemoveResource take an
IAssemblyResourceor just a resource name?IAssemblyResource.And maybe we should also support adding/removing multiple resources with a single call, as with
AddAssemblyReferences?Yes, why not? It's easy.
Pull request closed