Comments (6)
I'm sorry but I'm completely unsure what you're asking here.
When calling Import, Cecil only imports metadata that doesn't belong to the current module. Now it does this when you actually call Import, but what would be the advantage of delaying it until the file is actually serialized ?
from cecil.
I have the case where a TypeDefinition is created in an assembly, and I create another assembly with an new TypeDefinition that has the first one as base class.
In fact I should need a trick to avoid importing the first TypeDefinition and to have Cecil makes it itself...!
from cecil.
I don't see what's the issue here.
In assembly Foo, you add type A.
In assembly Bar, you modify the base type of type B with the result of Import (A).
And that's about it.
from cecil.
In fact I wonder if Cecil could do the job for the developer (I mean to call the Import method)...
from cecil.
Cecil can not do that at write time, because it would break the principle that in an object graph, everything shares the same module. In that case, the BaseType would have a different module, which is wrong.
So that would mean that to be solved, we would have to modify every setter, such as BaseType to say:
this.base_type = (value.Module != this.Module) ? this.Module.Import (value) : value;
Which ends up being very weird. You set a property with a value and the property ends up with another value, which is unintuitive.
All in all, it's much simplier to let the user do the proper import, especially when it has to import open generic types, which require a context.
from cecil.
OK, you agree.
This issue can be closed.
from cecil.
Related Issues (20)
- Subsequent write operations create different outputs HOT 6
- Type resolution depends on the program that is running, not the assembly being processed. HOT 7
- Chat room HOT 3
- Constant type misidentified as primitive
- [Question] OpCodes.Conv_U
- System.IndexOutOfRangeException: Index was outside the bounds of the array HOT 1
- Constant serialization
- Update readme discussion info
- Reflection & System.Runtime [& self references?] HOT 3
- Release a new version supporting RVA field alignment HOT 1
- Unity 2022 Queue.Clear Resolve returns null.
- No way to sign a netstandard assembly from a .NET >=6 app? HOT 1
- Specified method is not supported. HOT 1
- .NET Framework 4.8.1 - Failed to resolve assembly: netstandard, Version=2.0.0.0 HOT 3
- Easiest way to map document paths in portable [embedded] PDBs?
- Stack overflow when running tests
- Failed to extract SQLite.SQLiteException
- Exception when writing assembly with a null call instruction HOT 1
- Link in README goes to betting site HOT 2
- Problem with weawing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cecil.