The server sent a response which SharePoint Designer could not parse

by michel 17. December 2008 08:13

At this moment I'm building different kind of webparts for MOSS 2007. Some of these webparts are using the nice new fancy .Net 3.5 stuff. Because webparts are running in the SharePoint context you need to upgrade SharePoint to .Net .5 to get it to work.

Thanks to Jan Tielen I found an easy way to do this, hereby the 6-step tutorial:

  • Start Visual Studio 2008.
  • Create a new dummy ASP.NET Web Application Project, and make sure you target the .NET Framework 2.0 (upper right dropdown of the New Project dialog). The name of this project is not important; you won’t need it anymore when we’re done.
  • Copy the web.config of your SharePoint 2007 site, into the dummy Web Application project in Visual Studio.
  • Open the Project Properties in Visual Studio (right click on the Project node in the Solution Explorer, and choose Properties; or in the Project menu, select WebApplicationX Properties).
  • Select .NET Framework 3.5 in the Target Framework dropdown (select Yes in the confirmation dialog).
  • Copy the web.config from the Web Application Project back to SharePoint.

After doing this I did some testing inside SharePoint. Everything seemed to work. Until the next day...

The day after I needed to some things with my 'favorite tool' "SharePoint designer". I connected to my test-machine and try to open a aspx-file inside the designer (the application tree was shown as normal). I got the following error:

The server sent a response which SharePoint Designer could not parse. If you are trying to connect to a Windows SharePoint Services server, check with the server's administrator to make sure Windows SharePoint Services is installed properly.

Because I just upgraded the to .NET 3.5 , I knew the cause would be somewhere in the web.config file. After some digging  found out that inside the httpHandlers something went wrong:

<httpHandlers>
    <remove verb="GET,HEAD,POST" path="*"/>
    <add verb="GET,HEAD,POST" path="*" type="Microsoft.SharePoint.ApplicationRuntime.SPHttpHandler, ....."/>
    <add verb="OPTIONS,PROPFIND,PUT,LOCK,UNLOCK,MOVE,COPY,GETLIB,PROPPATCH,MKCOL,DELETE,(GETSOURCE),....."/>
    <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.Http....."/>
    <add verb="*" path="_vti_bin/ReportServer" type="Microsoft.ReportingServices.SharePoint.Soap.RSP....."/>
    <add verb="*" path="Reserved.ReportViewerWebPart.axd" type="Microsoft.ReportingServices.SharePoi....."/>
    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFacto....."/>
    <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHa....."/>
    <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, ....."/>
    <remove verb="*" path="*.asmx"/>
</httpHandlers>

 

The <remove verb="*" path="*.asmx"/> key is removing the ScriptHandlerFactory (3 lines above) registration.

Solving is easy, move the <remove verb="*" path="*.asmx"/> key up to the top just below the <remove verb="GET,HEAD,POST" path="*"/> key. In this example your httpHandler section would look like this:

<httpHandlers>
    <remove verb="GET,HEAD,POST" path="*"/>
    <remove verb="*" path="*.asmx"/>            
    <add verb="GET,HEAD,POST" path="*" type="Microsoft.SharePoint.ApplicationRuntime.SPHttpHandler,....."/> 
<
add verb="OPTIONS,PROPFIND,PUT,LOCK,UNLOCK,MOVE,COPY,GETLIB,PROPPATCH,MKCOL,DELETE,(GETSOURCE)....."/> <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.Htt....."/> <add verb="*" path="_vti_bin/ReportServer" type="Microsoft.ReportingServices.SharePoint.Soap.RS....."/> <add verb="*" path="Reserved.ReportViewerWebPart.axd" type="Microsoft.ReportingServices.SharePo....."/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFact....."/> <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptH....."/> <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler,....."/>
</
httpHandlers>

 

Making changes in the Web.config will cause the application pool to restart, don't do this in a live productional system during working hours, restartig SharePoint takes ages :)

Tags: , , , ,

.Net | Debug | SharePoint

SharePoint unit testing without SharePoint!

by Michel 27. November 2008 08:22

Ever heard about TypeMock?? TypeMock is a tool which simplifies unit testing. As a not proffie unit testing I can tell that TypeMock is pretty easy to learn....

TypeMock has a pretty cool tool now for unit testing SharePoint, it´s called Isolator For SharePoint. It´s the only tool that allows you you unit test your SharePoint application without SharePoint.

I do not have any experience with the tool yet, I´ll keep updates posted on this topic... Did you btw know that you can get a license for free??

So how do I get the Free License?J ust make a post on your blog or site about the latest Typemock product, that includes the below text:Typemock are offering their new product for unit testing SharePoint called Isolator For SharePoint, for a special introduction price. it is the only tool that allows you to unit test SharePoint without a SharePoint server. To learn more click here. The first 50 bloggers who blog this text in their blog and tell us about it, will get a Full Isolator license, Free. for rules and info click here.

Tags: , , ,

.Net | Debug | SharePoint | Tooling

Up the ramp

by michel 13. November 2008 07:37

Ever heard about the free, online, community-based learning program from Microsoft Ramp Up?

Specifically Designed Learning Plans
We understand that different development skills have different learning needs. That's why Ramp Up comprises multiple learning plans, each designed with the unique learning needs of different developers in mind. Whether you’re just starting your software development career or a seasoned professional wanting to build your skills on the latest Microsoft technology, Ramp Up bridges the gaps you want to close.

Trusted Experts Guide Your Way
Ramp Up is a program built by expert developers for developers. Each learning plan comprises of premium technical content developed by renowned experts—famous authors, MVPs, and developer community leaders.

Success Is the Destination
Upon completion, you will have built a solid foundation of professional development skills and increased your proficiency with Microsoft Visual Studio 2005 and the Microsoft .NET Framework 2.0. You will also earn a graduation award comprising discounted learning and certification offerings. That gets you recognized and marked for advancement.

 

At the moment they have a nice SharePoint 2007 developer and a Visual Studio 2008 course... go check it out!

Tags: , , ,

.Net | SharePoint | Microsoft

Microsoft Enterprise Library 4.1 is OUT

by Michel 13. November 2008 07:27

Tags: , ,

.Net | Microsoft

ADO.Net Services not showing anything in browser

by Michel 10. November 2008 10:59

Having the problem as well that, when you are testing your ADO.Net Services in Internet Explorer, the browser is not showing anything?

This 'error' occurs when the 'Turn on feed reading view' option is enabled. To disable this, do the following:

Open IE, go to Tools > Internet Options > Content > Feeds (Settings) > Un-tick 'Turn on feed reading view'

Turn on feed reading view enabled Turn on feed reading view Disabled

Turn on feed reading view Enabled

Turn on feed reading view disabled

 

kick it on DotNetKicks.com

Tags: , , , ,

.Net | C# | Debug

WCF: Cannot load the X.509 certificate identity specified in the configuration

by Michel 2. November 2008 13:57

When doing the WCF introduction from Microsoft / PluralSight I got the following error at screencast 2 when trying to run the test application:

 

System.InvalidOperationException: Cannot load the X.509 certificate identity specified in the configuration.
   at System.ServiceModel.Description.ConfigLoader.LoadIdentity(IdentityElement element)
   at System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress)
   at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection)
   at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, String configurationName)
   at System.ServiceModel.ServiceHostBase.ApplyConfiguration()
   at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)
   at System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses)
   at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)
   at Microsoft.Tools.SvcHost.ServiceHostHelper.CreateServiceHost(Type type, ServiceKind kind)
   at Microsoft.Tools.SvcHost.ServiceHostHelper.OpenService(ServiceInfo info)

 

The example is giving you a wsHTTP contract which relies WS-Security layer. Because in this example you are running locally, you could remove the <certificateReference> tags in the app.config.

If you receive this error when not running it locally, try to resolve the certificate from the destination party and import the certificate into Internet Explorer. That should do the trick.

kick it on DotNetKicks.com

Tags: , , ,

Updates on the MSSharePointDeveloper site

by Michel 13. October 2008 06:42

en_moss2007-logo The MSSharePointDeveloper site has been around for a while right now.There have been some nice new releases around.

Here's the new stuff you can find there. The VM's have been updated to Visual Studio 2008, which is awesome!

  • Downloadable WSS Dev VPC Image
    • Updated to Visual Studio 2008 (previously Visual Studio 2005).
    • Smaller download at about 1.8Gb to download in 4 files now.
    • The Virtual PC image includes:
      • Windows Server 2003 (expires on 29th September 2009)
      • Windows SharePoint Services 3.0 SP1
      • Visual Studio 2008
      • Visual Studio 2008 extensions for Windows SharePoint Services
      • 10 Hands on Labs for learning SharePoint in C# and VB.NET
  • SharePoint Developer Introductory Hands on Labs
    • All updated to Visual Studio 2008.
    • They are included on the VM image.
    • They are also available for separate individual downloads from the site.
  • SharePoint Developer Introductory Web Cast PPTs and Demos
    • 10 webcast PPTs with transcripts.
    • Previously 2 of the webcasts were missing transcripts.

All three of these downloads and online MSDN Virtual Labs are available at MSSharePointDeveloper

kick it on DotNetKicks.com

Tags: , , ,

SharePoint

DebuggerStepThroughAttribute

by michel 10. October 2008 16:01

I love to check out somebody else his or her code. I always learn something from it. Just a couple of days ago I had an example from Scott Allen about WWF and ASP.Net.

In his code example I found a class with different small data checks. Each static method was decorated with the ´DebuggerStepThroughAttribute´.

public static class Check
{
    [DebuggerStepThrough]
    public static void IsNotNull(object argument, string message)
    {
        if (argument == null)
        {
            throw new InvalidOperationException(message);
        }
    }
}
Scott Allen, source code example

 

Not exactly knowing what the attribute meant (besides what the name is telling you) triggered me to ask it Google :)

By placing System.Diagnostics.DebuggerStepThrough attribute above a method, you instruct the debugger to step through that method and not into it. With other words this instruction will cause the debugger not to step into method as normal, but you can always place a breakpoint in that method and stop there.

Hmm sweet isn't it :) Hopefully it's useful for you as well.

kick it on DotNetKicks.com  

Tags: , , ,

C# | Debug

Configure Microsoft Source Analysis

by Michel 26. May 2008 17:54

Last friday Microsoft released the first version of Source Analysis (also known as StyleCop) for C# via the new Source Analysis webblog. A lot of developers complained about the lack of configuration options for this tool. After some digging I found the solution.

The configuration section is found under your visual studio project file:

 

After pressing the Source Analysis Settings option you will get the following form:

 

Ajust the settings you would like and press apply/ok.

If you wish to keep your adjusted settings for all your projects, do the following steps: 

  • Go to your Microsoft Source Analysis installation directory (default: C:\program files\Microsoft Source Analysis Tool for C#)
  • Locate and backup the Settings.SourceAnalysis file
  • Go to your project directory where you ajusted the Microsoft Source Analysis settings and locate the Settings.SourceAnalysis
  • Copy the Settings.SourceAnalysis to the Microsoft Source Analysis installation directory.
  • Now all the changes you made are the default settings.

Tags: , ,

Tooling

About the author

Michel TolMy name is Michel Tol. I'm a developer specialized in .NET technologies. Mainly focussing on SharePoint Technologies and web development. I am Certified Technology Specialist for MOSS 2007 -  Configuration, .Net Framework 2.0 - Web applications and Biztalk Server 2006 - Custom Applications.

View Michel Tol's profile on LinkedIn

  

E-mail me Send mail

Page List