Sharepoint 2007: Trace Management Service unable to delete file ‘Filename’. Error 5

After moving your MOSS log files (etc. c-drive to d-drive) around, you are possible missing few folder permissions. Your MOSS log files are not deleted and are filled with the error in the title.

Add MODIFY rights to LOCAL SERVICE account in the new logs-folder and your error should be history.

WSPBuilder: How to enable custom workflows in existing project

 I had an old WSPBuilder project and I wanted to add workflow to it. The old project was created with WSPBuilder project template and with .Net Framework 2.0.

For people who are not interested in my strugle with this problem, skip these first 12 steps :)  For others, these are the steps I had to go through:

  1. I tried adding WSPBuilders Sequential Workflow Feature workflow directly to the project. It worked nicely.
    • After that I got three reference warnings (System.Workflow.Activities, .ComponentModel and .Runtime)
  2. I had to change target framework from 2.0 to 3.5. (Right click on project -> properties -> Target Framework). After that the references worked.
  3. I opened the workflow feature to designer mode and was greeted with these two nice messages
    • The service ‘System.Workflow.ComponentModel.Compiler.ITypeProvider’ must be installed for this operation to succeed. Ensure that this service is available.
    • The service ‘System.Workflow.ComponentModel.Design.IIdentifierCreationService’ must be installed for this operation to succeed. Ensure that this service is available.
  4. After some googling  Binging I found out that I needed to add more project type GUIDs to my *.csproj file.
    • Right click on project -> Unload project. Right click on project -> Edit *.csproj
    • Change the key <ProjectTypeGuids> to the following line
    • <ProjectTypeGuids>{F8810EC1-6754-47FC-A15F-DFABD2E3FA90};{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    • Right click on project -> Reload project
  5. Yeah, now I could edit the workflow in designer!
  6. I drag-and-dropped few tasks to the workflow, tried building it and it was good! I was already very excited to get this thing working.
  7. Deployed the solution to MOSS. Right click on project -> WSPBuilder -> Build WSP. Right click on project -> WSPBuilder -> Deploy.
  8. Added workflow to list and created new item. Nothing happened…
  9. Checked the workflow status and reviewed the logs to find these messages
    • From workflow status: Failed on start (retrying)
    • From MOSS logs: Engine RunWorkflow: System.Workflow.ComponentModel.Compiler.WorkflowValidationFailedException: The workflow failed validation
  10. After some more Binging found out that I also have to add some target-files (what every those are…)
    • Right click on project -> Unload project. Right click on project -> Edit *.csproj
    • Add the following new the key under the existing <Import Project=”$(MSBuildBinPath)\Microsoft.CSharp.targets” />
    • <Import Project=”$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets” />
    • Right click on project -> Reload project
  11. Build, deploy and have fun with your workflow!

And here is the same info in a nutshell:

  1. Change the projects target framework to 3.5
  2. Unload your project and modify your *.csproj file
  3. Change the project type GUIDs to this
    • ProjectTypeGuids>{F8810EC1-6754-47FC-A15F-DFABD2E3FA90};{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
  4. Add this line under the existing <Import Project=”$(MSBuildBinPath)\Microsoft.CSharp.targets” /> key
    • <Import Project=”$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets” />
  5. Reload project, build, deploy and enjoy!

Virtualization: Too small virtual hard drive?

Is your virtual harddrive running low on free disk space? I have created many 20-30 GB VHD’s (accidentally or was it even some kind of default in Virtual PC 2007?) to contain Windows Server 2008, MOSS 2007 and so on… Sooner or later the hard drive is running out of space just when you’d need to install Infopath or Visio (Insert anything important here that currently stops you from doing your job) or something like that.

There is a small but very usefull program from vmToolkit called VHD Resizer. The tool can be downloaded freely, but requires registration. The tool creates exact copy of your existing VHD-file and at the sametime you can expand your VHD file to maximum of 127GB (VHDResizer seems that it could make it bigger, but Virtual PC said maximum is 127GB).

  1. Open up VHD Resizer and browse to your VHD-file. Enter folder and filename for the new harddrive. Click Resize to start.
    VHDResizer
  2. Fire up the virtual machine with the new larger harddrive and start Disk management tool (either from computer management or WIN+R and Diskmgmt.msc)
  3. Select the partition that you want to extend and right click on it. Select Extend.
    Diskmgt_Extend
  4. If you want to use the whole disk for the one partiotion, just click next next next and finish. You are all done!

Notice! This works only for Vista/Windows7/Server2008, with earlier OS’s you need to use Diskpart.exe from the command line. Command line syntax for that can be found here. The basic syntax is like this:

extend [size=n] [disk=n] [noerr]

Parameters
size=n : The amount of space, in megabytes (MB), to add to the current partition. If you do not specify a size, the disk is extended to take up all of the next contiguous unallocated space.

disk=n : The dynamic disk on which to extend the volume. An amount of space equal to size=n is allocated on the disk. If no disk is specified, the volume is extended on the current disk.

noerr : For scripting only. When an error is encountered, specifies that DiskPart continue to process commands as if the error did not occur. Without the noerr parameter, an error causes DiskPart to exit with an error code.

An unhandled exception occurred in the user interface.Exception Information: OSearch (Administrator) & SPSearch (Administrator)

I got these errors when starting both Search Services from sharepoint central admin. The problem occurred because I just defined the username, not the computer name or domain name. The services started working after I entered username like domain\username.

Sharepoint Event ID 6102 – LoadBalancer.RegisterLauncher failed

I have this problem in my environment, but still haven’t quite figured it out. Event log shows error every 30-60 seconds and the error is like this:

Event Type: Error
Event Source: Office SharePoint Server
Event Category: Launcher Service
Event ID: 6102
Date: 8/10/2009
Time: 8:00:00 ÁM
User: N/A

Computer: server1

Description: LoadBalancer.RegisterLauncher failed: Unable to connect to the remote server

Here’s a list of different possible solutions to this problem:

  • Go to the Sharepoint Central Administration -> Operation -> Service Account. Change Load Balancer service account to “Network Service” or “Local Service”
  • Restart the Document Conversion Load Balancer service and Document Conversion Launcher service with services.msc (win+R -> services.msc)
  • Problems with SSP: add more permissions to the SSP user, create new SSP
  • Shutdown Document conversion launcher service and document conversion if you don’t need them
  • Add read/execute permissions for IIS_WPG group to the Inetpub-folder
  • Change IIS Application pool identity for sharepoint to “Local System”

Testing It Out: Taskbar Progressbar

This new feature is adds a great value for users, because now one does not need to keep the program visible to see the progress of any process (Report, web service call, download etc…) This feature is implemented already at least in the Internet Explorer 8 (Windows 7 version) and the file explorer (copying/moving).

Using the Windows7APICodepack to implement this feature is very easy and fast task. Here’s an example:

?View Code CSHARP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
 
using Microsoft.WindowsAPICodePack.Taskbar;
 
namespace TestingStuffOut
{
    public partial class Form1 : Form
    {
        Timer timer;
        int value;
 
        public Form1()
        {
            InitializeComponent();
 
            timer = new Timer();
 
            timer.Enabled = true;
            timer.Interval = 250;
            timer.Tick += new EventHandler(timer_Tick);
            timer.Start();
 
            progressBar1.Style = ProgressBarStyle.Blocks;
            progressBar1.Minimum = 0;
            progressBar1.Maximum = 100;
            progressBar1.Step = 1;
 
            value = 0;
        }
 
        void timer_Tick(object sender, EventArgs e)
        {
            // Reset the counter when it reaches maximum
            if (value == progressBar1.Maximum) value = 0;
            else value += 10;
 
            progressBar1.Value = value;
 
            // Here's the Taskbar Progressbar part
            TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Normal);
            TaskbarManager.Instance.SetProgressValue(progressBar1.Value, progressBar1.Maximum);            
        }
    }
}

And the example looks like this:

Normal mode

Normal mode

Error mode

Error mode

Paused mode

Paused mode

There was also a indeterminate mode (continuous), but I did not have time to test it also (means, I did not get it to work after one try and it’s very late :) )

Be sure to check out other parts of the “Testing It Out” series from the series starting page!

Testing It Out: Developing for Windows 7 with C#

I don’t do much pure Windows development. I’m more of a sharepoint guy myself, but these new Windows 7 features got me to boot up my visual studio and start testing these features out. When I started searching information about these features and using them in my programs, I found out that there is an API code pack for .NET Framework, because these features are not yet implemented directly to it.

Things to do before you can use these new features through API code pack:

  1. Download the API code pack from codeplex
  2. Unzip the WindowsAPICodePack-archive
  3. open the solution WindowsAPICodePack with Visual Studio and Build it
  4. Get the DLL-files from from each project folder and copy them somewhere safe
  5. Add reference to the DLL you need in your Visual Studio project

I’ll update a list of “Testing It Out” series here:

Windows 7 and Live Messenger Icon

If you have used WLM with earlier MS operating systems, you may have gotten used to the small WLM icon at the notification area (lower right corner). After installing Windows 7, the icon does not go to the notification area, but instead goes to the task bar :( The icon does not go away until you completely close messenger (and we all know how it does not like to do that). Here’s a picture:

Picture of WLM in Windows 7

Picture of WLM in Windows 7

 If you want it to work like it used to work in Vista or XP, all you have to do is this:

  1. Browse to the WLM installation folder (ex. C:\Program Files (x86)\Windows Live\Messenger)
  2. Right click on msnmsgr.exe and select properties
  3. Select tab Compatibility and choose XP or Vista from the drop down ”Run this program in compatibility mode for:”
  4. Accept the changes and startup Messenger.
  5. Write a comment to my blog and thank me :) Just kidding…

Here’s how it should look after the changes:

Picture of WLM in Windows 7 in XP compatibility mode

Picture of WLM in Windows 7 in XP compatibility mode

I tried using WLM with the “Windows 7 way”, but I really did not like it. If you have some opinions about this or have understood the idea why is it like this, please let me know!

Wohoo! Windows 7 RTM published to the MSDN

For the last few days I have constantly refreshed and checked my MSDN Subscription RSS feed (and double checked the web page, just to be sure) to know when the Windows 7 and 2008 server R2 is published… And now my long wait has been answered!

Windows 7 can be downloaded from MSDN today, but some of us still need to wait. Rest of the release schedule can be found from Windows Team Blog. Windows 2008 server R2 is still nowhere to be seen :(

Visual Studio 2010 & .NET Framework 4.0 Beta 1 available

Downloads currently available only for MSDN users, but non-MSDN users will be able to download the packages on wednesday!

Info about the new features and download links can be found here.