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

Sunday, January 23, 2011

C# - Static Constructors

• You declare a static constructor by "static" keyword in front of the constructor name.
• To initialize static fields in a class you can use static constructor.
• A static constructor is called before an instance of a class is created
• A static constructor is called before a static member is called.
• A static constructor is called before the static constructor of a derived class.
• A static constructor does not take access modifiers or have parameters.
• A static constructor cannot be called directly.
• They are called only once.
• Can't access anything but static members.

class MyClass
{
// Static constructor
static MyClass()
{
//...
}
}

Share/Bookmark

Sunday, January 9, 2011

Visual Studio 2010 runs faster when the Windows Automation API 3.0 is installed

Applications that use Windows Automation APIs can significantly decrease Microsoft Visual Studio IntelliSense performance if Windows Automation API 3.0 is not installed. For example, the Windows pen and touch services can significantly decrease Visual Studio IntelliSense performance if Windows Automation API 3.0 is not installed.
http://support.microsoft.com/kb/981741
Share/Bookmark

Sunday, January 2, 2011

http://twitter.com/fbayanati


Tweets
Share/Bookmark

T-SQL Copy database diagrams to another database

Unlike stored procedure, functions, tables, views, ... MS Sql server doesn't have an easy way to script or create database diagrams. It keeps all the diagrams in [sysdiagrams] system table.

SELECT *
FROM sysdiagrams

USE newDb
GO

INSERT INTO sysdiagrams
([name], pricipal_id, version, definition)
SELECT [name], pricipal_id, version, definition
FROM #tempDiagrams

Share/Bookmark

Saturday, December 25, 2010

Greenshot - a free screenshot tool


Greenshot is a light-weight screenshot software tool for Windows.

Greenshot was published under GPL, i.e. this software can be downloaded and used free of charge, even in a commercial environment.
Share/Bookmark

Sunday, December 19, 2010

Smallest Dot Net

Get smallest .Net framework possible!

An interesting one page web site can help you to find out which version of .NET has been installed in your system. It also provide details and estimate about the size of download which makes your system up to date with latest .NET version.
Share/Bookmark