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 3 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 5.0 by 2 people

  • Currently 5/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