When using a custom HTTP module and you create a view for a list you get an error saying Cannot complete this action. Please try again.


This post is a contribution from Aravinda Devagari, an engineer with the SharePoint Developer Support team

When you are using a custom HTTP module with a SharePoint site, you will notice that if you go ahead and create a custom list view you will get an error: “Cannot complete this action.  Please try again.” This is primarily because the HTTP module reads the request body and there is no request body left for the OWSSVR.dll to read. We will find 404 error in IIS.

The only workaround available for this is:

Bypass the HTTP module when the URLs contain OWSSVR.dll, so a simple If statement on the HTTPModule’s Begin request event and check if the request URL contains  “OWSSVR”, if it does, do not read or process the request body. You could use the following snippet of code, to achieve this requirement:

public class CustomModule : IHttpModule
    {
        public void Init(HttpApplication application)
        {
            application.BeginRequest += new EventHandler(this.OnBeginRequest);
        }
        void OnBeginRequest(object sender, EventArgs e)
        {
            if (HttpContext.Current.Request.Url.AbsolutePath.ToLower().Contains("owssvr.dll"))
            {
                return;
            }
        }
    }


Comments (1)

  1. Westley says:

    This is a blacklist approach, and will fix the issue with RPC requests, but there may be other URLs that would be problematic for the same reason (other RPC calls like author.dll). If possible, adopt a whitelist approach of checking the URLs for what you
    want to process instead of what you don't want to process. Make it explicit. This will also improve performance as your code won't have to run as often.

Skip to main content