Tags down


How to use GetMethod in my own class obfuscated by ConfuserEx?

By : Bob Baty-Barr
Date : October 14 2020, 02:24 PM
To fix this issue I'm still not sure why you can't just create the delegate you need directly without reflection, but if you really need to get the MethodInfo, try doing something like this:
code :
using System;
using System.IO;

class Program
    static void Main(string[] args)
        Thingy t = DoStuff;
        var mi = t.Method;
    private delegate void Thingy(object sender, EventArgs e);
    private static void DoStuff(object sender, EventArgs e)


Share : facebook icon twitter icon

Java Error: The method getMethod(String, Class<boolean>) is undefined for type Class

By : Ross Schaefer
Date : March 29 2020, 07:55 AM
seems to work fine Update 2
The compile-time error suggests, that you are using Java 1.4 to compile the class. Now, in Java 1.4, it was illegal to define array parameters as Type..., you had to define them as Type[], and this is the way the getMethod is defined for the Class:
code :
Method getMethod(String name, Class[] parameterTypes)
MyClass.class.getMethod("myMethod",new Class[] {boolean.class}));
super(new ClickHandler() {

    // This is anonymous class body 
    // You cannot place code directly here. Embed it in anonymous block, 
    // or a method.

    try {
    } catch (Exception e) {
public ClickHandler(Method method) {

    try {
    } catch (Exception e) {

public MyClass() {
    super(new ClickHandler(MyClass.class.getMethod("myMethod",boolean.class)));

Why can't I do Class.GetMethod() but I can do this.GetType().GetMethod()?

By : hongwang.li
Date : March 29 2020, 07:55 AM
I wish this helpful for you GetMethod is a method declared on the Type class... not on the class you're looking at. (In particular, that class could also have a GetMethod method, which would confuse things significantly...)
You can use
code :

How do you Publish a Xamarin.Android App that's Obfuscated with ConfuserEx?

By : Timothe Conklin
Date : March 29 2020, 07:55 AM
I wish did fix the issue. I ended up getting this to work in a more roundabout way.
First, in your project file for your App.Droid, under add true. This will generate an unsigned APK when you rebuild your project.
code :
<Target Name="Obfuscate" AfterTargets="_CopyIntermediateAssemblies" Condition="'$(Configuration)' == 'Release'">
    <Exec Command="ObfuscateRelease.bat" WorkingDirectory="$(SolutionDir)" />
echo running ObfuscateRelease.bat
:: Call Confuser ex to obfuscate your project
START /WAIT "Obfuscating App.dll" "<Path to Confuser>\ConfuserEx\Code\Confuser.CLI.exe" "<Path to Confuser Ex file>\NormalObfuscate.crproj"
:: copy confused files into the release folders so it is packaged into the app
echo starting to copy
copy "<Path to App>\App\App.Droid\bin\Confused\App.dll" "<Path to App>\App\App\App.Droid\bin\Release"
copy "<Path to App>\App\App.Droid\bin\Confused\App.dll" "<Path to App>\App\App.Droid\obj\Release\linksrc"
copy "<Path to App>\App\App.Droid\bin\Confused\App.Droid.dll" "<Path to App>\App\App.Droid\bin\Release"
copy "<Path to App>\App\App.Droid\bin\Confused\App.Droid.dll" "<Path to App>\App\App.Droid\obj\Release\linksrc"
echo finished copying
echo finished ObfuscateRelease.bat

How to convert primitive long datatype to Class type for Class.getMethod(methodName, Class...);

By : Brian Dodwell
Date : March 29 2020, 07:55 AM
this will help Java considers long and Long as two different types. The former is a primitive type while the latter is a reference type. You need the Class object of the former.
You can get the class of long by doing long.class. Actually, you can get the Class object of any class by doing ClassName.class.
code :
Class<fun> clazz = fun.class;
Method method = clazz.getMethod("getBox",long.class, String.class);

Can Class.getmethod find the method include type of Class< ? > paramter?

By : user2788386
Date : March 29 2020, 07:55 AM
Does that help You can't pass null as the value of a parameter to getDeclaredMethod.
Pass the class literal instead:
code :
ReflectDemo.class.getDeclaredMethod("t00", Class.class,String.class)
Related Posts Related Posts :
  • C# - OleDBDataAdapter.Fill(DataSet) throws "No value given for one or more required parameters. "
  • What happens if we don't use DTOs in our API?
  • How to display to the console list from another class?
  • EF Core Db First - filter out tables based on schema name
  • How to do JSON POST
  • How to safely change the unique key with Entitiy Framework - Database First
  • CS0103 Error in Visual Studio on simple project containing only a textbox and button
  • How to make custom user claims be available in API requests
  • SharpZipLib throw System.IO.FileNotFoundException on commit update
  • C# - check if substring is present in arraylist of strings
  • SSIS Script Task move all files not working
  • Unhandled exception occurs after handling exception
  • Reading selected checkboxes as int
  • Why projection is not including navigation nested properties in EF Core 2.0?
  • Structure to XML C# WinForms
  • Manipulate textbox on gridview C#
  • C# similar bitwise operations resulting in different answers
  • Linq to SQL Random Timeouts on Simple Small Queries
  • Return type as IEnumerable instead of just List?
  • How to get transient DbContext in ASP.NET MVC Core?
  • Grouping data in ViewModel ASP.NET MVC & C#
  • Using a parameter's property in an ArgumentException
  • EF Unable to determine the relationship represented by navigation property
  • Moq: running flows with FluentValidation
  • "Reset" switch statement after value is equal
  • What does the question mark followed by a period mean if it is next to a variable?
  • How to P/Invoke os_log?
  • Deep copy object properties (including those with private setter) to another object of the same type
  • How to generate new back colour if two object's back colour match?
  • How to calculate percentage of value inside arbitrary range?
  • typeof(T) when T is dynamically created is null?
  • Run the application faster with Run Query at Start
  • c# code returns System.Data.DataSet instead of Data itself?
  • Compile binaries to multiple versions of .NET Framework using Bazel
  • How to hide table rows in a DataList if column data returns null from SQL Server
  • Exception handling with lambda/linq statements
  • Creating a meal Cost calculator C#
  • Plugin Failing on D365 v9 Online when I just have tracers to test execution
  • ASP.NET MVC Deleting row from one table after copying it to another table
  • Error VSSDK1001: Unable to find Microsoft.VisualStudio.CommandTable.VSCTCompiler type
  • Trying to fetch a string from another form but i get string value null
  • Entity Framework equivalent of the following query?
  • How do I get projection of one list to another with Linq?
  • I am using Alpha Vantage API to try and pull daily stock info. I am really new to using APIs and don't know what I am do
  • Get column names and types out of XMLSchema
  • Unable to read large log file with MemoryMappedViewStream
  • looping through file to add to datagridview
  • C# How do I ask for Admin, without "forcing" him
  • System.ComponentModel.Win32Exception: "The system cannot find the file specified"
  • How to add list to SQL query?
  • Visitor pattern: Number arithmetics based on input
  • How to remove a single DataLabel from a Chart made with EPPlus and C#
  • GameObjects will not load after game Restarts
  • Getting all dates between two dates using datepickers and Entity Framework 6
  • What should TResult be when using public async Task to return json response from API HTTP Post
  • Automapper Sub Property Mapping
  • reading a json file exception "Unhandled Exception: System.TypeInitializationException: The type initializer for &q
  • How to get MacOS username in .NET Core console app?
  • How can I extract the first word of every line of a text file in C#
  • HttpClient isn't using Client Certificate for Mutual TLS Auth
  • shadow
    Privacy Policy - Terms - Contact Us © voile276.org