Question: I would like to access a function of a program from which is attached a DLL.

In DLL I've tried:

```
Assembly assembly = Assembly.GetExecutingAssembly();
Type type = assembly.GetType("Uranium");
MethodInfo methodInfo = type.GetMethod("Util");

methodInfo.Invoke("SendClient", new object[] { Packet.GetData()});

```

But not works I get a null exception but not say the line.
The running program is called and namespace is 'Uranium', the class is 'Util' and function is 'SendClient'.

Answer: 
I have been able solve it on my own.

Code:

```
Assembly assembly = Assembly.LoadFrom("Uranium.exe");
Type type = assembly.GetType("Uranium.Util");
MethodInfo methodInfo = type.GetMethod("SendClient");

methodInfo.Invoke(null, new object[] { Packet.GetData() });

```
From what I can read from the code you've posted you try to invoke the function Util of class Uranium. And you're passing a string as the instance of the class.

This should be more like what you're trying to do:

```
Assembly assembly = Assembly.GetExecutingAssembly();
Type type = assembly.GetType("Util");
MethodInfo methodInfo = type.GetMethod("SendClient");

methodInfo.Invoke(Activator.CreateInstance(type), new object[] { Packet.GetData()});

```

If `SendClient` is a static member function then `Activator.CreateInstance(type)` can be replaced with `null`.
And of course you should add checks that the `GetType` and `GetMethod` return values are not `null`