byme8 / apparatus.aot.reflection Goto Github PK
View Code? Open in Web Editor NEWReflectionless reflection
License: MIT License
Reflectionless reflection
License: MIT License
Hi there,
Can I use this library for dynamically loading assemblies (like plugins) at the runtime like I currently do with reflection?
Today I'm using reflection to:
Thank you for your work! You've already got my star :)
I was wondering if you could have a generic way to solve:
public Frame(StackFrame? frame)
{
_methodBase = frame.GetMethod();
}
When you look at the inplementation you can see that it's not available in IOT
///
```
if (exception is not null && exception.GetType().Name.Equals("SqlException", StringComparison.OrdinalIgnoreCase))
{
#pragma warning disable IL2075 // 'this' argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The return value of the source method does not have matching annotations.
var props = GetExceptionTypeWithProperties(exception).GetProperties(BindingFlags.Public | BindingFlags.Instance);
#pragma warning restore IL2075 // 'this' argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The return value of the source method does not have matching annotations.
foreach (var property in props)
{
//sqlException
switch (property.Name)
{
case "Procedure":
_sqlProcedureName = property.GetValue(exception) as string;
break;
case "LineNumber":
if (property.GetValue(exception) is int iSqlLineNumber)
_sqlLineNumber = iSqlLineNumber;
break;
case "Number":
if (property.GetValue(exception) is int iSqlErrorNumber)
_sqlErrorNumber = iSqlErrorNumber;
break;
case "Server":
_sqlServer = property.GetValue(exception) as string;
break;
case "Source":
_tSql = property.GetValue(exception) as string;
break;
case "ErrorCode":
if (property.GetValue(exception) is int iSqlErrorCode)
_sqlErrorCode = iSqlErrorCode;
break;
}
}
}
SqlException comes from more than one namespace and in my lib I do not reference any of them but I am still interested in sending crash diagnostics without having to write a special resolver for it.
If you have a class
partial class Person
{
[Required]
public string FirstName { get; set; }
public string LastName { get; set; }
}
then compiling gives the error:
error CS0051: Inconsistent accessibility: parameter type 'Person' is less accessible than method 'CopyConstructor_PersonExtensions.GetProperties(Person)'
1>Done building project "ApparatusAOT.csproj" -- FAILED
I know this is a bit of a non-issue, but could you please put a license on the project? In legal terms nobody's allowed to interact with your code if you don't. No viewing, no modifying, no using, Nothing at all. (Same for the nuget package)
Is it possible to get method and events with this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.