Dark Theme for VS2010

This is a really nice and quite readable theme!



Duplicating a Partition in Windows 2008 Server

I won’t go into the details, but I used the following tools and info which came in really handy:






How to create a setup project for a windows service in VB.NET

Here is a great write up on making your vb.net windows service easy to install.

This worked the first time I tried it, which I can’t say for every instruction list I find on the “Internets”.


This article describes how to create a setup project for a Windows Service application (formerly named an “NT service”). To do this, you must first create a solution that contains a simple Windows Service project that writes an entry to its application log. You then add a setup project to the solution to install the Window Service. Finally, you start the service. You can start the service by using the Services item in the Administrative Tools folder in the Start menu.


The following list outlines the recommended hardware, software, network infrastructure, and service packs that you must have:

  • Microsoft Windows 2000, Windows XP, Windows Server 2003, or a later Microsoft operating system with the .NET Framework installed
  • Microsoft Visual Studio .NET Enterprise, Microsoft Visual Studio .NET Enterprise Architect, Microsoft Visual Studio 2005, or Microsoft Visual Studio 2008.

This article also assumes that the user account that you use to install and to run this service has the permissions that you must have to install and to start services, and also has the permissions that you must have to access the event log.

Create a Setup Project for a Windows Service

This section describes how to create a Windows Service project, and how to use a compiled setup project to install the Windows Service.

Create a Windows Service Project

  1. Start Microsoft Visual Studio.
  2. On the File menu, point to New, and then click Project.
  3. Click Visual C# Projects under Project Types, and then click Windows Service under Templates.Note In Visual Studio 2005 or Visual Studio 2008, expand Visual C# under Project Types, click Windows, and then clickWindows Service under Templates.
  4. Type LogWriterService in the Name text box, and then type C:\ in the Location text box. Click OK.
  5. In Solution Explorer, right-click Service1.cs, and then click View Code.
  6. In the OnStart event handler, replace the comments with the following code:
    EventLog.WriteEntry("My simple service started.");
  7. In Solution Explorer, double-click Service1.cs.
  8. In the Code Editor window, right-click Design View, and then click Properties
  9. In the Properties pane, click the Add Installer link.
  10. In the Properties pane for ServiceInstaller1, change the ServiceName property to Service1.
  11. In the Code Editor window in Design view, click ServiceProcessInstaller1.
  12. In the Properties pane, change the Account property to LocalSystem (The LocalService and NetworkService values are available only in Microsoft Windows XP).

Use a Compiled Setup Project to Install the Windows Service

After you complete the steps in the previous section to configure the Windows Service project, follow these steps to add a deployment project that packages the service application so that the service application can be installed:

  1. Add a new project to your LogWriterService project. To do this, follow these steps:
    1. In Solution Explorer, right-click Solution ‘LogWriterService’ (1 project), point to Add, and then click New Project.
    2. Click Setup and Deployment Projects under Project Types, and then click Setup Project under Templates.
    3. In the Name text box, type ServiceSetup.
    4. Type C:\ in the Location text box, and then click OK.
  2. Tell the deployment project what to package. To do this, follow these steps:
    1. In Solution Explorer, right-click ServiceSetup, point to Add, and then click Project Output
    2. In the Add Project Output Group dialog box, in the Project box, click LogWriterService
    3. Click Primary Output, and then click OK.
  3. For correct installation, add only primary output. To add the custom actions, follow these steps:
    1. In Solution Explorer, right-click ServiceSetup, point to View, and then click Custom Actions
    2. Right-click Custom Actions, and then click Add Custom Action.
    3. Click Application Folder, and then click OK.
    4. Click Primary output from LogWriterService (Active), and then click OK.Notice that Primary output appears under InstallCommitRollback and Uninstall.
  4. By default, setup projects are not included in the build configuration. To build the solution, use one of the following methods:To install the newly built service, right-click ServiceSetup, and then click Install.
    • Method 1
      1. Right-click LogWriterService, and then click Build.
      2. Right-click ServiceSetup, and then click Build.
    • Method 2
      1. On the Build menu, click Configuration Manager to build the whole solution.
      2. Click to select the Build check box for ServiceSetup.
      3. Press F7 to build the whole solution. When the solution is built, you have a complete installation package that is available for the service.
  5. In the ServiceSetup dialog box, click Next three times. Notice that a progress bar appears while the service installs.
  6. When the service is installed, click Close.

Original article at: http://support.microsoft.com/kb/816169

Add index to FoxPro .DBF from .NET using VFPOLEDB and OLEDB

I looked for hours until I found this solution:

The INDEX command is not suported for OLE DB.
However, as a work-around you can use code like the following:

Dim cn1 As New OleDbConnection(Provider=VFPOLEDB.1;Data Source=C:\Temp\;”)
Dim cmd1 As New OleDbCommand(“Create Table TestIndex (Field1 I, Field2 C(10))”, cn1)
Dim cmd2 As New OleDbCommand( _
“EXECSCRIPT([SELECT 0]+CHR(13)+CHR(10)+[USE TestIndex EXCLUSIVE]+CHR(13)+CHR(10)+[INDEX ON Field1 TAG Test])”, cn1)

This worked fantastic!

[original link here]

Adding a linked 2000 server to SQL 2012

I installed SQL 2012 and did my usual “add a linked server” to get to my other one (a 2000 server), and it would not allow the connection. As part of Microsoft’s “moving on'” directive, the latest SQL Client on 2012 won’t talk to 2000.

You can add it alternatively using the sp_addlinkedserver stored procedure:

EXEC master.dbo.sp_addlinkedserver @server=N’YourServerHere’,@srvproduct=N”””,@provider=N’MSDASQL’,@provstr=N’DRIVER={SQL Server};SERVER=YourServerHere;Trusted_Connection=yes;’

I’m not doing anything fancy, just querying tables and inserting data and this appears to work fine.

VS2010: The Signer’s certificate is not valid for signing

Wha?? I was just publishing an app like always and received this error. At first, I thought it was because I had to reinstall VS2010, but it’s actually a simple certificate issue.

It turns out they expire. Go under your PROJECT PROPERTIES and look at the SIGNING tab.

In my case, the Expiration date had come and gone.

You have the option of turning off the signing, but instead I just clicked the “CREATE TEST CERTIFICATE” button and my build/publish went on without issue. I did get a warning about replacing my app with a different certificate version, but that was okay.

gen exists but is not a source folder. Convert to a source folder or rename it

I just had this error while trying out some Java Android sample code in Eclipse.  

I found a good fix on stackoverflow while reading through some comments:

  1. Right click on the project and go to “Properties”
  2. Select “Java Build Path” on the left
  3. Open “Source” tab
  4. Click “Add Folder…”
  5. Check “gen” folder and click Ok and Ok again
  6. Again right click on the project and in the “Andriod Tools” click on “Fix Project Properties”