This project is read-only.

Unknown Error

Nov 19, 2009 at 9:55 PM

Hi Vouter

I'm new to Sharepoint, and I'm trying your very nice tool, your sample code works perfectly, but for some reason I can't figure out when I try and create my own Project (I follewed the description in your video, workflow.xml is changed with <Task_0_FormUrl></Task_0_FormUrl>.)

I've tried several times, but with no luck when it comes to having a custom editform, in my latest project I left out the istantiation and association, to keep it very very simple, but still no luck, I'm pretty sure its a stupid mistake on my part,
but I have no idea where to start, I tried to debug the project, but it says unable to start the .dll - same happens in your sample project.

Looking through the previous posts on the subject it seems like you want to see the workflow.xml, so here it is:

<font size="2" color="#0000ff"><font size="2" color="#0000ff">


</font></font><font size="2" color="#0000ff">



xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="">
Workflow Id="{1B81F0C4-D2B9-4466-84A6-066D1A18DF02}"
Description="WhGov Security Issue"
Title="WhGov Security Issue" 
CodeBesideAssembly="WhyGovSecIssue, Culture=neutral, Version=, PublicKeyToken=43a0c7d92c9bdf8d"
CodeBesideClass="WhyGovSecIssue.Workflow1" TaskListContentTypeId="0x010801004E4FD5D508784092AA20394584759B99">

Any help is greaty appreciated.

Nov 19, 2009 at 10:18 PM

My guess is that the markup in the custom .ascx file has a problem.  If you haven't already, make sure you change the debug and callstack settings in your web.config file.  This will allow a better error message to be shown.  If that error message doesn't help, go ahead and post it and the .ascx file.

Nov 19, 2009 at 11:32 PM

Hi Chris,

Thanks for you quick reply, in the meantime I tried following the video combined with the changes according to the sample code, I'm getting the following error:

Object reference not set to an instance of an object.   at TPG.SharePoint.Workflow.TaskData.GetProperty(Object key)
   at TPG.SharePoint.Workflow.TaskData.get_Item(Object key)
   at ASP._controltemplates_whygovprojtest_whygovtaskcontrol_ascx.LoadData(Boolean isInitialLoad) in c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES\WhyGovProjTest\WhyGovTaskControl.ascx:line 42
   at TPG.SharePoint.Workflow.WorkflowDataControl`2.OnLoad(EventArgs e)

In this try I implemented Association and Instatiation, which both runs fine, my workflow.xml is now:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="">
  <Workflow Id="{9CA2B6CD-DF40-4dfd-B6B5-C10717E5E07D}"
            Description="WhyGov Test Project"
            Title="WhyGov Test"
            CodeBesideAssembly="WhyGovProjTest, Culture=neutral, Version=, PublicKeyToken=c4f4ffd246ce6401"

The WhyGovTaskControl.ascx is, note I did try without my own assemblies, as I saw it was suggested, but in the sample code it's included, so I tried both ways:

<%@ Control Language="C#" AutoEventWireup="true" Inherits="TPG.SharePoint.Workflow.TaskControl, TPG.SharePoint.Workflow, Version=, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="tpg" Namespace="TPG.SharePoint.Workflow.Controls" Assembly="TPG.SharePoint.Workflow, Version=, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Assembly Name="TPG.SharePoint.Workflow, Version=, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Assembly Name="WhyGovProjTest, Culture=neutral, Version=, PublicKeyToken=c4f4ffd246ce6401" %>
<%@ Import Namespace="TPG.SharePoint.Workflow" %>
<%@ Import Namespace="WhyGovProjTest" %>
<%@ Import Namespace="Microsoft.SharePoint" %>

<tpg:InputForm ID="inputForm" runat="server">
    <tpg:InputFormSection ID="InputFormSection1" runat="server" Title="Instructions" Description="Please read and / or alter these instructions prior to approving or disapproving the item.">
            <asp:Label ID="instructionsField" runat="server" />
    <tpg:InputFormSection ID="InputFormSection2" runat="server" Title="Comments" Description="Please enter any comments you may have.">
            <tpg:InputFormControl ID="InputFormControl1" runat="server" LabelText="Your Comments">
                    <asp:TextBox ID="commentsField" runat="server" Width="100%" Rows="5" TextMode="MultiLine" />   
    <tpg:ButtonSection ID="ButtonSection1" runat="server" ShowStandardCancelButton="false">
            <asp:Button ID="Button1" runat="server" Text="Approve" CommandName="Commit" CommandArgument="Approve" />
            <asp:Button ID="Button2" runat="server" Text="Reject" CommandName="Commit" CommandArgument="Reject" />
            <asp:Button ID="Button3" runat="server" Text="Cancel" CommandName="Cancel" />       

<script type="text/C#" runat="server">
    protected override void LoadData(bool isInitialLoad)
        if (isInitialLoad)
            TaskData data = GetData();
            commentsField.Text = data["Comments"] as string;

    protected override TaskData SaveData(object commandArgument)
        TaskData data = new TaskData();
        data["Comments"] = commentsField.Text;
        data["Result"] = commandArgument;
        return data;

Sorry to ask for help this late, but I'm really stuck, and will be extatic to be able to start working with your cool tool.


Nov 19, 2009 at 11:49 PM

Hi Chris,

I'm sorry I think I was starring blind at the code, the problem which is probably obvious to anyone but me is that in LoadData if it's running for the first time will try to set a field value with a null value.

Thanks though for helping with displaying usefull errormessages, I have the callstack to false...

Have a good night.

Klaus :)