BCS Error "The server was unable to process the request due to an internal error."

Posted by | Filed under

When trying to access the Business Data Services Application Proxy, I got the error "The server was unable to process the request...". I also noticed that the Secure Store service was giving a WCF-related error.

 At any rate, what I did to fix my particular error is start the "Claims to Window Token Service" which stopped for some reason. BCS started working again after doing so.

 This post is what pointed me in the right direction and gives more information:
http://www.intheknow.it/Default.aspx?Page=ssserror&NS=&AspxAutoDetectCookieSupport=1

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Making DelayActivity Work In SharePoint 2010

Posted by | Filed under , , , ,

In the previous MOSS 2007 version of SharePoint, there was an issue of delay activities in workflows not waking up because of how the SharePoint workflow runtime works.

 Sadly, Microsoft didn't reslove the issue by default with SharePoint 2010. You still have to jump through some hoops to get it running (usually after scratching your head as to why it doesn't work and scouring the internet for solutions).

 It turns out that the way to get things running is to dust off stsadm.exe and run the following commands:

stsadm -o setproperty -pn job-workflow -pv "Every 5 minutes between 0 and 59" -url http://webappurl
stsadm -o setproperty -pn workflow-eventdelivery-throttle -pv "45"

Thanks to StackOverflow for pointing me in the right direction.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Rename the "Title" Field in a SharePoint List Definition

Posted by | Filed under , , , ,

Sometimes you'll want to override the name of the default (required) "Title" field on a SharePoint list definition. At first, it's a bit confusing how to do so, because to make your "Title" rename comprehensive, you have to change not only the "Title" field's display name, but also "LinkTitle" and "LinkTitleNoMenu".

Luckily, doing so isn't difficult. Either find the fields below in your list definition, or add them in the <Fields/> element. From there, simply change the "DisplayName" attribute (not the "Name" or "StaticName", which should remain unchanged).

<Field DisplayName="Custom Title" ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Type="Text" Name="Title" Required="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Title" FromBaseType="TRUE" />
<
Field DisplayName="Custom Title" ID="{bc91a437-52e7-49e1-8c4e-4698904b2b6d}" ReadOnly="TRUE" Type="Computed" Name="LinkTitleNoMenu" DisplayNameSrcField="Title" AuthoringInfo="(linked to item)" EnableLookup="TRUE" ListItemMenuAllowed="Prohibited" LinkToItemAllowed="Prohibited" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="LinkTitleNoMenu" FromBaseType="TRUE">
   <
FieldRefs>
      <
FieldRef Name="Title" />
      <
FieldRef Name="LinkFilenameNoMenu" />
   </
FieldRefs>
   <
DisplayPattern>
         <IfEqual>
            <Expr1>
                <LookupColumn Name="FSObjType"/>
       </
Expr1>
            <Expr2>1</Expr2>
                 <Then>
            <
Field Name="LinkFilenameNoMenu"/>
                </Then>
         <
Else>
            <
HTML><![CDATA[<a onfocus="OnLink(this)" href="]]></HTML>
            <
URL/>
            <HTML><![CDATA[" onclick="EditLink2(this,]]></HTML>
            <
Counter Type="View" />
            <
HTML><![CDATA[);return false;" target="_self">]]></HTML>
            <
Column HTMLEncode="TRUE" Name="Title" Default="(no title)" />
            <
IfEqual>
               <Expr1>
                 <
GetVar Name="ShowAccessibleIcon" />
               </
Expr1>
               <
Expr2>1</Expr2>
               <Then>
                  <HTML><![CDATA[<img src="/_layouts/images/blank.gif" class="ms-hidden" border="0" width="1" height="1" alt="Use SHIFT+ENTER to open the menu (new window)."/>]]></HTML>
               </Then>
            </
IfEqual>
            <HTML><![CDATA[</a>]]></HTML>
            <
IfNew>
               <HTML><![CDATA[<img src="/_layouts/1033/images/new.gif" alt="]]></HTML>
               <
HTML>New</HTML>
               <
HTML><![CDATA[" class="ms-newgif" />]]></HTML>
            </
IfNew>
         </
Else>
      </IfEqual>
   </DisplayPattern>
</Field>
<Field DisplayName="Custom Title" ID="{82642ec8-ef9b-478f-acf9-31f7d45fbc31}" ReadOnly="TRUE" Type="Computed" Name="LinkTitle" DisplayNameSrcField="Title" ClassInfo="Menu" AuthoringInfo="(linked to item with edit menu)" ListItemMenuAllowed="Required" LinkToItemAllowed="Prohibited" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="LinkTitle" FromBaseType="TRUE">
   <FieldRefs>
      <FieldRef Name="Title" />
      <
FieldRef Name="LinkTitleNoMenu" />
      <
FieldRef Name="_EditMenuTableStart2" />
      <
FieldRef Name="_EditMenuTableEnd" />
   </
FieldRefs>
   <DisplayPattern>
   <FieldSwitch>
      <Expr>
         <GetVar Name="FreeForm" />
      </Expr>
      <Case Value="TRUE">
         <Field Name="LinkTitleNoMenu" />
      </Case>
      <Default>
        <Switch>
          <Expr>
             <GetVar Name="MasterVersion" />
          </
Expr>
          <Case Value="4">
             <
HTML><![CDATA[<div class="ms-vb itx" onmouseover="OnItem(this)" CTXName="ctx]]></HTML>
             <
Field Name="_EditMenuTableStart2" />
             <
HTML><![CDATA[">]]></HTML>
             <Field Name="LinkTitleNoMenu" />
             <HTML><![CDATA[</div>]]></HTML>
             <
HTML><![CDATA[<div class="s4-ctx" onmouseover="OnChildItem(this.parentNode); return false;">]]></HTML>
             <HTML><![CDATA[<span>&nbsp;</span>]]></HTML>
             <HTML><![CDATA[<a onfocus="OnChildItem(this.parentNode.parentNode); return false;" onclick="PopMenuFromChevron(event); return false;" href="javascript:;" title="Open Menu"></a>]]></HTML>
             <
HTML><![CDATA[<span>&nbsp;</span>]]></HTML>
             <HTML><![CDATA[</div>]]></HTML>
          </Case>
          <Default>
             <
HTML><![CDATA[<table height="100%" cellspacing="0" class="ms-unselectedtitle itx" onmouseover="OnItem(this)" CTXName="ctx]]></HTML>
             <Field Name="_EditMenuTableStart2" />
             <HTML><![CDATA["><tr><td width="100%" class="ms-vb">]]></HTML>
             <
SetVar Name="ShowAccessibleIcon" Value="1" />
             <Field Name="LinkTitleNoMenu" />
             <
SetVar Name="ShowAccessibleIcon" Value="0" />
             <HTML><![CDATA[</td><td><img src="/_layouts/images/blank.gif" width="13" style="visibility:hidden" alt=""/></td></tr></table>]]></HTML>
          </Default>
       </Switch>
      </Default>
    </FieldSwitch>
   </DisplayPattern>
</Field>

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Getting the Strong Name of an Assembly (Now That Reflector 6.8 Doesn't Seem To)

Posted by | Filed under , , , ,

Red Gate software recently updated their Reflector product to the last free version (6.8). Unfortunately, they also seemed to take away the feature I used the most, namely the ability to get the strong name of an assembly (which is often needed for SharePoint development).

 Luckily, the tool's capability is easy to replace. I simply created a Windows Forms app with a Button, an OpenFileDialog and a TextBox for displaying the strong name. The code to extract the full name of the assembly is as follows, which I added here in the Button.Click event handler. Naturally, button1 is the Button, openFileDialog1 is the OpenFileDialog and textBox1 is the TextBox. You can rename or change the controls however you wish.

private void button1_Click(object sender, EventArgs e)
{

    // Show the open file dialog and get user input.
    DialogResult result = openFileDialog1.ShowDialog();
    if (result == DialogResult.OK)
    {
        // Assuming you pick a .dll, this code will load it and then display
        //the strong name in the TextBox control of the form.

         var
assembly = Assembly.LoadFile(openFileDialog1.FileName);
         textBox1.Text = assembly.FullName;
    }
}

 UPDATE: RedGate fixed the problem and the strong name section is there again if you download the latest version.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Solved! - The service 'System.Workflow.ComponentModel. Compiler.ITypeProvider' must be installed for this operation to succeed.

Posted by | Filed under , , ,

I'm working on a SharePoint project where several componenets (Workflow, List Definitions, Content Types, etc.) are tightly related to the same functionality. To reduce the risk of components breaking because of an out-of-sequence or missing dependency, and just to make things easier, I wanted to throw everything together in the same project. I discovered something interesting about Workflows in the process, however.

Namely, if you try to add a Workflow to a typical project, you'll get an error in the Workflow designer saying:

     "The service 'System.Workflow.ComponentModel.Compiler.ITypeProvider' must be installed for this operation to succeed."

This happens if you added references to the proper assemblies (System.Workflow.Activities, System.Workflow.ComponentModel, System.Workflow.Runtime and microsoft.sharepoint.WorkflowActions)!

Odd, but luckily there are solutions. One is to write a bunch of code to build the support that the Workflow Designer needs, but I was looking for something even simpler. What I discovered, is that you can add support for Workflows to your project (the .csproj or .vbproj file) by cracking it open in notepad and adding some "ProductTypeGuids" to the project XML. Just add both of the GUIDs featured in the ProjectTypeGuids element below (or add the element if it's not there), and you should be good to go!

<PropertyGroup>
    ...
    <AssemblyName>MyCompany.Technnology</AssemblyName>
    <ProjectTypeGuids>{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    ...
  </PropertyGroup>

 I'm curious to see if you can add these GUIDs to many types of projects to enable Workflow support (and further curious about if there are any consequences apart from designer support),

Currently rated 5.0 by 4 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Creating an SPWeb From Its Absolute URI

Posted by | Filed under ,

A collegue of mine recently asked a fairly common question for SharePoint developers getting familiar with the SharePoint API; "If I have the absolute URI of my web, how do I use it to instantiate a corresponding SPWeb object?"

You'd assume that the SPWeb would have a constructor that accepts an absolute URI, but that isn't the case. What you have to do is first create an SPSite using your URI, then call the parameterless OpenWeb() method on it.

string uri = "http://server/site/subsite/web";

//remember your "using" statements so the SPSite and SPWeb are properly disposed
using(SPSite site = new SPSite(uri))
//here, OpenWeb() opens the web corresponding to the URI passed to the SPSite constructor
using (SPWeb web = site.OpenWeb())
{
    //use your web here
}

Currently rated 4.7 by 3 people

  • Currently 4.666667/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Warning About .NET Framework 3.5 SP1, SQL Server 2008 and WSS 2.0

Posted by | Filed under ,

I got this information through the grapevine. For those using the latest version of the .NET Framework and/or SQL Server 2008, but using the older version of Windows SharePoint Services, this is pretty important.

As a heads up the product team will be updating the System Requirements for WSS v2 to reflect that support for .NET Framework 3.5 and .NET Framework 3.5 SP 1 are not supported on WSS v2.  This would include Visual Studio 2008 SP 1 that includes .NET Framework 3.5 SP 1.

 

Note:  The product team will also be updating system requirements to exclude support for SQL Server 2008 as well since it did not receive exhaustive testing either.  There are no known issues with it so far but the product team feels they need to draw the line on older versions of SharePoint and what they support.

 

Symptoms

If .NET Framework 3.5 SP 1 is installed on WSS v2 the symptoms are:

 

Each web part will display the following error:

 

Web Part Error: A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe.

 

Also, the following NT Events are reported:

 

NT Event Viewer Application Log displays multiple error warnings:

Event ID: 1000

Error initializing Safe control - Assembly: Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c TypeName: * Namespace: Microsoft.SharePoint.SoapServer Error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

 

Due to the fact that .NET Framework 3.5 was not tested thoroughly we are retroactively removing support for it.

 

Workaround:

Workaround:  Uninstall In Add/Remove Programs remove Microsoft .NET Framework 3.5 SP 1 and Microsoft .NET Framework 3.0 and uninstall Microsoft .NET Framework 2.0.  Then reinstall .NET Framework 2.0 Service Pack 1 Download Here.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5