Semaphore Timeout Period

After troubleshooting this for hours and sitting on the phone with my hosting group they discovered that there was a problem with their networking configuration. The solution was made clearer when during my testing one of the VM’s suddenly couldn’t find the domain, and a simple ‘ping’ to the IP of each box from the … Read more

Custom app.config Config Section Handler

First you add a property in the class that extends Section: [ConfigurationProperty(“pages”, IsDefaultCollection = false)] [ConfigurationCollection(typeof(PageCollection), AddItemName = “add”)] public PageCollection Pages { get { return (PageCollection) this[“pages”]; } } Then you need to make a PageCollection class. All the examples I’ve seen are pretty much identical so just copy this one and rename “NamedService” … Read more

Stairway pattern implementation

Application entry points should be the composition root, as per Mark Seemann’s excellent book on Dependency Injection. Here, the issue is more about Dependency Inversion, whereby both client and implementation should both depend on abstractions. What that diagram doesn’t show, but hopefully other parts of the book make clear, is that the entry point will … Read more

Problem when trying to use EventLog.SourceExists method in .NET

This is a permissions problem – you should give the running user permission to read the following registry key: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\EventLog Alternaitvely you can bypas the CreateEventSource removing the need to access this registry key. Both solutions are explained in more detail in the following thread – How do I create an Event Log source under … Read more

References from class library are not copied to running project bin folder

Explanation For a sample scenario let’s say we have project X, assembly A, and assembly B. Assembly A references assembly B, so project X includes a reference to both A and B. Also, project X includes code that references assembly A (e.g. A.SomeFunction()). Now, you create a new project Y which references project X. So … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)