Comments (4)
It's possible that you're hitting an indexer. Currently GetBackingField works only for traditional properties. Could you paste the code of the property that triggers the exception ?
from mono.reflection.
Oh now that was quick :)
The property & backingfield are the following:
private string _department;
/// <summary>
/// Gets or sets the department.
/// </summary>
/// <value>The department.</value>
public string Department
{
get
{
Activate(ActivationPurpose.Read);
return _department;
}
set
{
Activate(ActivationPurpose.Write);
_department = value;
}
}
(it's using db4o's transparent activation mechanism in the Property there)
from mono.reflection.
GetBackingField reads the IL of the property to find a certain pattern, specific to simple properties. As you have calls to methods in them, they stop being simple properties.
Now, it's possible to write a custom IL pattern to look for. That's your lucky day, I already wrote the pattern for db4o properties here:
from mono.reflection.
Nice! Thanks Jean-Baptiste for the quick help!
from mono.reflection.
Related Issues (17)
- bug in short branch target calculation HOT 3
- MethodBodyReader is implied internal HOT 2
- Add support for DynamicMethod and dynamic compiled methods
- Nuget package out of date. HOT 1
- Non-standard IL code can crash the library HOT 6
- DLL produced causes LoaderException during AssemblyLoad in vNext HOT 5
- "Operation could destabilize the runtime." when using IL to create a DynamicMethod HOT 2
- .NET Standard support HOT 5
- Can we use DelegateDecomiler when we obfuscate the code?
- Some instructions for noobs HOT 2
- Executing result of GetInstructions HOT 1
- GetBackingField() extension method fails when being run by code coverage report HOT 2
- Specify a copyright holder for the license
- Is there anyway I can use the getInstructions() with mono cecil IL processer to insert the instructions ?
- How to work with Async method
- Detect call to overriden method HOT 1
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 mono.reflection.