Comments (13)
It's already supported, as properties (and events) are included in the Methods property in Cecil (unlike Reflection).
from ignoresaccesscheckstogenerator.
Well, seems like it is not - I was trying to expose some properties on Avalonia DataGrid e.g. DataGrid.SlotCount (for read only) and it was not exposed without my modifications
internal int SlotCount
{
get;
private set;
}
Neither many others - e.g. VisibleSlotCount or RowGroupHeadersTable or HorizontalScrollBar:
internal IndexToValueTable<DataGridRowGroupInfo> RowGroupHeadersTable
{
get;
private set;
}
internal ScrollBar HorizontalScrollBar => _hScrollBar;
from ignoresaccesscheckstogenerator.
I modified your project to add some functionality that I need and created a new repo while giving you the proper attribution. Please, take a look at DotNetBinaryAdjuster
from ignoresaccesscheckstogenerator.
It sounds like your fork is permanently patching assemblies, not just providing access to internals at compiletime while still running the original assembly at runtime?
from ignoresaccesscheckstogenerator.
It sounds like your fork is permanently patching assemblies, not just providing access to internals at compiletime while still running the original assembly at runtime?
To tell you the truth, I am not sure. It works for me and I thought I followed everything from IgnoresAccessChecksToGenerator. If you think I did something wrong, please, be specific - it could have easily happened since I do not know much about mono.cecil.
Thanks
from ignoresaccesscheckstogenerator.
It sounds like your fork is permanently patching assemblies, not just providing access to internals at compiletime while still running the original assembly at runtime?
I just realized - my attempt at virtualization did not work - the old method is still being called. I guess it is not as good as I hoped it would be.
from ignoresaccesscheckstogenerator.
I just realized - my attempt at virtualization did not work
Ye that was what I meant, things like that require permanent patching, since it affects runtime and not compile time.
Generally, turning private to public may not always work either, I've run into a lot of problems doing that on framework assemblies and given up on it eventually.
from ignoresaccesscheckstogenerator.
I just realized - my attempt at virtualization did not work
Ye that was what I meant, things like that require permanent patching, since it affects runtime and not compile time.
Any ideas or links on how to patch it permanently - e.g. create another dll and use it instead of the original one?
from ignoresaccesscheckstogenerator.
I just realized - my attempt at virtualization did not work
Ye that was what I meant, things like that require permanent patching, since it affects runtime and not compile time.
Any ideas or links on how to patch it permanently - e.g. create another dll and use it instead of the original one?
Well, you just do the same, use Mono.Cecil during build time to rewrite the assembly, but not just for the compiler input. Frameworks doing that exist but I never used them, check maybe https://stackoverflow.com/questions/189359/what-is-il-weaving for ideas on where to look.
Alternatively do it outside the buildchain and just do the occasional manual processing tool run to generate your modified version whenever your dependencies need to be updated. Can easily write a console tool to rewrite assemblies with Mono.Cecil.
Obviously need to check if licenses allow to distribute modified versions of third party code.
from ignoresaccesscheckstogenerator.
Thanks man, I work with Avalonia - which is open source under MIT license, so I do not expect any copyright problems
Eventually in order to avoid the weaving somersaults and jumping jacks, Avalonia will have to make its code a bit easier to modify it without resorting to extreme measures or completely re-writing its packages. I'll probably give them some ideas after being done with this exercise.
from ignoresaccesscheckstogenerator.
@weltkante , sorry, as I mentioned before I am pretty new to Cecil. It seems like the modified assembly is saved by the call to
assembly.Write(target);
But even if I use that saved assembly, it is not performing the override. What am I doing wrong? Perhaps you can recommend some websites where cecil is explained?
from ignoresaccesscheckstogenerator.
That should work, if it doesn't something went wrong with your modifications. Can't really recommend any guides since I just learned it by trial & error myself and reading code like this repo. What I'm usually doing is writing a console app that loads the assembly, modifies it, and writes it back under a different name - then use ilspy to verify my edits. If I need a reference to how something needs to look at the IL level I write a dummy c# project just doing the one thing I need to know how it looks and open the assembly in ILSpy, then replicate it in Mono.Cecil. Thats relly all there is to it as far as I'm concerned.
from ignoresaccesscheckstogenerator.
Thanks @weltkante !
from ignoresaccesscheckstogenerator.
Related Issues (15)
- System.ArgumentException: An item with the same key has already been added. HOT 9
- .NET Core 2 Release giving IgnoresAccessChecksToGenerator.targets(12,5): error MSB4044: The "PublicizeInternals" task was not given a value for the required parameter "AssemblyNames". HOT 1
- Should InternalsAssemblyNames be an MSBuild Item, not a Property? HOT 8
- AssemblyResolutionException when publicizing internals on .Net Framework 4.6 HOT 2
- Does not open access to private methods HOT 5
- Doesn't work with WPF projects HOT 13
- Error "Could not load file or assembly ***" when I use it in console app (but it works in tests project) HOT 3
- unknown build error HOT 2
- Maybe remove old Generated Assemblys on clean of project/solution HOT 1
- Monodevelop: analyzer uses original reference instead of generated one HOT 2
- Add supports F# HOT 1
- Incremental build issues with IgnoresAccessChecksTo.cs HOT 1
- Suggestion HOT 4
- [Feature Request] Add `<autogenerated />` comment to generated file header
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 ignoresaccesscheckstogenerator.