How to fix the The type specified in the TypeName property of ObjectDataSource could not be found error in a SharePoint custom solution

The type specified in the TypeName property of ObjectDataSource could not be found error

I was coding away happily developing a custom Reporting Services report for a SharePoint Web Part. The Web Part hosts a local Reporting Services report (.rdlc) and it’s using an ObjectDataSource as the data source, and I was getting the type specified in the TypeName property of ObjectDataSource could not be found error.

So in my code I have a data class with a select method, so my constructor looks like this:

ObjectDataSource ds = new ObjectDataSource(“MyNameSpace.MyClass”, “GetObjects”);

However, when executing the report, I got this error:

The type specified in the TypeName property of ObjectDataSource ” could not be found

I had put my assembly in the SafeControl section in Web.config, and the assembly was in the GAC.

It turns out that it also needs to be referenced in the <assemlbies> list of the <compiliaton> section, like this:

<compilation batch=”false” debug=”false”>

<assemblies>

<add assembly=”MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=123456789ABCDEF” />

</assemblies>

……

And now it worked.

How to debug Potentially excessive number of SPRequest objects error message

You may have seen this error message in your SharePoint log file.

“Potentially excessive number of SPRequest objects (10) currently unreleased on thread 5. Ensure that this object or its parent (such as an SPWeb or SPSite) is being properly disposed. This object will not be automatically disposed.”

Now this means that you have some (custom) code in your SharePoint installation that doesn’t dispose its memory allocation correctly. You have code that leak memory.

The error message in the log doesn’t say much on where this memory leak happens, which makes it a little bit difficult to trouble shoot. However, there is a way to tell SharePoint to tell you more on where this happens by also writing out the stack trace in the log file.

Open RegEdit and browse to the

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\HeapSettings

key. Edit the SPRequestStackTrace DWORD Entry and set it to 1.

You will now geta full stack trace whenever this error message appears, which makes it so much easier to trouble shoot.

How to install Microsoft Office SharePoint Server 2007

Download the installation media from Microsoft, or use your supplied DVD media. I recommend you to apply the latest service pack 2 to the media files. Unfortunately, at this time of writing, there are no slipstreamed Service Pack 2 media, but you can follow this guide to make your own.

Start the setup.

image

image

Select Complete.

image

image

image

image

image

Select Create a new server farm.

image

Enter the database server name and the Database Access Account

image

Select the default values.

image

image

 image