Question: I was wondering how I would go about setting up the virtual hosts so that I just have to enter www.mydomain.com:9090 to go to phpmyadmin. This is how I have my vhosts set up right now in httpd.conf:

```
<VirtualHost *:80>
    DocumentRoot /var/www/html/
    ServerName mydomain.com
    ServerAlias www.mydomain.com
</VirtualHost>

<VirtualHost *:9090>
    DocumentRoot /usr/share/phpMyAdmin/
    ServerName mydomain.com
    ServerAlias www.mydomain.com
</VirtualHost>

```

This does not seem to be working.

Answer: 
When unhooking an event, it needs to be the same delegate. Like this:

```
public class Foo
{
     private MyDelegate Foo = ClientEntityCache_CacheCleared;
     public void WorkItem()
     {
         ClientEntityCache.EntityCacheCleared += Foo;
     }

     public void Dispose()
     {
         ClientEntityCache.EntityCacheCleared -= Foo;
     }
}

```

The reason is, what you are using is syntactic sugar for this:

```
public class Foo
{
     public void WorkItem()
     {
         ClientEntityCache.EntityCacheCleared +=
new MyDelegate(ClientEntityCache_CacheCleared);
     }

     public void Dispose()
     {
         ClientEntityCache.EntityCacheCleared -=
new MyDelegate(ClientEntityCache_CacheCleared);
     }
}

```

So the `-=` doesn't unhook the original one you subscribed with because they are different delegates.
Maybe try:

```
 public void Dispose()
    {
      ClientEntityCache.EntityCacheCleared -= ClientEntityCache_CacheCleared;
      // Same thing for 10 other events
    }

```

You are creating a new event handler and removing it from the `delegate` - which effectively does nothing.

Remove the event subscription by removing reference to the ***original*** subscribing event method.

You could always just set your `eventhandler = delegate {};` In my opinion, that would be better than `null`.