Sunday, February 27, 2011

Windows Service or ASP.NET - System.Security.SecurityException when writing to Event Log

The solution was to give NetworkService and LocalService read (Full) permission on the EventLog/Security key.

To resolve you need to give the NetworkService/LocalService or ASP.NET user permission to read from the event log registry entries.

1. Select Start - Run, then enter: regedt32
2. Navigate to the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security
3. Right click on this entry and select Permissions.
4. Add the NetworkService/LocalService/ASPNET user.
5. Give it Read (Full) permission.
Share/Bookmark

Sunday, February 20, 2011

A little about ASP.NET MVC

ASP.NET MVC is a fascinating technology that provides an alternative to Web forms for building Web applications. Instead of building pages using server controls that provide relatively little control over the HTML they produce, MVC gives you complete control. ASP.NET MVC is based on the Model-View-Controller pattern. It’s good to mention that there are almost no limitations in how you provide data to an MVC application. I'll write more about ASP.NET MVC soon.
Share/Bookmark

.NET - Web services design tip

When a request comes in the receiver un-wraps it to figure out what objects got call.

"Do not include business logic in Web service implementation"
Instead, include objects that Web service instantiates and uses, in this way the whole
implementation is cleaner. The reason of implementing the business logic in elsewhere is because of being able to test them separately, implement them separately, and keep the things easier for maintenance and debugging.
Share/Bookmark

Saturday, February 12, 2011

C# - Static constructor cannot be overloaded

Static constructors are called before any other class members are called and called once only.Their main purpose is to initialize only the static members of a class. Static constructors cannot be overloaded.
Share/Bookmark