Skip to main content

Solved: for the error “Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list”

If you try to publish an ASP.NET web site in a computer on which ASP.NET wasn’t completely installed, you may face this annoying error:

HTTP Error 500.21 – Internal Server Error
Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

Result of inadequate ASP.NET installation
Result of inadequate ASP.NET installation

You can sort it out by fully installing ASP.NET. Open command prompt (Start > Run > cmd) and type the command following:

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
ASP.NET installation
ASP.NET installation

How to upload a file via FTP in C#

I will be showing how to upload a file via FTP by using .NET Framework’s native libraries.

The libraries we need are:

using System;
using System.IO;
using System.Net;
using System.Text;

The code block to upload a file (“tmp.csv” in my example):

FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://your-ftp-address//the-folder-if-you-want//tmp.csv");
request.Method = WebRequestMethods.Ftp.UploadFile;

request.Credentials = new NetworkCredential("username", "password");

byte[] fileData = File.ReadAllBytes("C:\\Users\\sourcefolder\\tmp.csv");
request.ContentLength = fileData.Length;

Stream requestStream = request.GetRequestStream();
requestStream.Write(fileData, 0, fileData.Length);

FtpWebResponse response = (FtpWebResponse)request.GetResponse();

MessageBox.Show("Upload File Complete, status {0}", response.StatusDescription);


How to send a post to your WordPress blog in C# and ASP.NET

XML-RPC service is used to send posts to WordPress blogs remotely. You can download the corresponding .NET library from here:

Add this library as a reference in your Visual Studio project. Then define it at the top of your code:

using CookComputing.XmlRpc;

The rest of the code is below.

public void wordpressPost()
    blogInfo newBlogPost = default(blogInfo);
    newBlogPost.title = "This is title";
    newBlogPost.description = "Post goes here";

    IgetCatList categories = (IgetCatList)XmlRpcProxyGen.Create(typeof(IgetCatList));
    XmlRpcClientProtocol clientProtocol = (XmlRpcClientProtocol)categories;

    clientProtocol.Url = ""; //your blog address comes here
    string result = null;

    result = "";

    result = categories.NewPage(1,
    "admin", //your blog admin user id
    "yourpassword", //your blog admin password

public struct blogInfo
    public string title;
    public string description;

public interface IgetCatList
    string NewPage(int blogId, string strUserName,
    string strPassword, blogInfo content, int publish);