.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

URL Rewriting works on localhost, not on inetput wwwroot or on live server

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ASP.Net

Hi guys,

I'm making a website and i have made a url rewriting module which works on my Visual Studio localhost area, but not on the Internet on a server or on my local machines inetpub wwwroot area. Any ideas what I need to tweak in IIS to fix it?

I'm on a windows 7 machine writing in VB.Net, using IIS 7.


Heres some of my code (which does work on localhost when i start the VS2008 debugger)

This is my web.config insert

			<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="UrlRewriteModule" type="theLibrary.rewrite"/>

Here is my rewriter itself, a bit scrappy but it works!


Imports System.Web
Imports System

Public Class rewrite
    Implements IHttpModule

    Public Sub Dispose() Implements IHttpModule.Dispose

    End Sub

    Public Sub Init(ByVal application As System.Web.HttpApplication) Implements IHttpModule.Init
        AddHandler application.BeginRequest, AddressOf Me.application_BeginRequest
        AddHandler application.BeginRequest, AddressOf Me.application_EndRequest
    End Sub
    Private Sub application_BeginRequest(ByVal sender As Object, By

View Complete Post

More Related Resource Links

HttpHandler works with Visual Studio Development Server debugging, but not otherwise


Hi all,

I'm new to HttpHandlers.  I am writing an HttpHandler that reads uploaded files directly from the request stream to provide progress that can be queried using an AJAX request.  For large files, this seems to be faster than having ASP.NET load the file contents into Request.Files and then streaming the file from there to wherever it goes (Linq to SQL into a VARBINARY column in an SQL Server database.)

My HttpHandler works perfectly when I'm debugging using the Visual Studio Development Server, but doesn't work otherwise.  The application pool for this application in IIS 7 is set to run in Classic Mode, and the Handler Mappings screen in IIS says that I must manage managed handlers in system.web/httpHandlers. 

I set up in my applications Web.config file.

<add verb="GET,POST" path="*.upload" type="Namespace.For.UploadHandler, AssemblyForUploadHandler"/>

It works great, so long as I don't debug with the "Use Local IIS Web server" option.

What else do I need to do to get this to work?


A connection could not be made to the report server http://localhost/ReportServer.



  • I created a Report using Business Intelligence Studio. Its working working well, i can able to view records. But when i try to deploy the report an error occurs specifying that "A connection could not be made to the report server http://localhost/ReportServer. (Microsoft Report Designer)".
  • I open the IIS 7 and find out virtual directories "Reports" and "ReportServer" are available.
  • I check on the browser and type "http://localhost/reports".  I find the browser direct to this url: http://localhost/reports/Pages/Folder.aspx and find error specifying the following one:

         Error:The report server is not responding. Verify that the report server is running and can be accessed from this computer.

  • when i type http://localhost/reportmanager, i found the error:

    HTTP Error 404.0 - Not Found

    The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.


Can't connect to SQL 2005 Enterprise using Management Studio with Server Name (only (local) works

This is a test system, everything running locally & no domains. Win 2003 Ent. Server & SQL Server 2005 Enterprise. I can't log into SQL Server Management Studio using the server name & using either Windows Authentication or SQL login. If I change the name of the server in the drop-down list to "(local)", I connect just fine (both Windows & SQL security modes). Shared Memory, Named Pipes & TCP/IP enabled in both server & client. Remote connections allowed. I have IP adresses (both & external IP) in my hosts file pointing to the server name. Does SQL require a DNS server? This wouldn't be a problem except for the fact that I can't install SQL 2005 SP3 due to authentication failure since there's no way to enter (local) as the server name. SQL tools (management studio, SP install) seem to see the SQL server running but won't authenticate the user through any means other than setting server name to (local). This is driving me crazy!!!

Execute an SSIS package from ASP.net (C#) - my package keeps failing. Help! - Works on localhost but

I'm looking for any and all information on how to execute an SSIS package from my asp.net web site. I have written the call and when I run the application from (Localhost) it works, but when I run it from the server it does not.Here is my code to call and execute the package: public string ProcessFiles(int ClientID, string FileName) { //System.Security.Principal.WindowsImpersonationContext impersonationcontext; //impersonationcontext = ((System.Security.Principal.WindowsIdentity)ServiceContext.User.Identity).Impersonate(); string packagePath = "\\\\\\Customer File Import.dtsx"; Microsoft.SqlServer.Dts.Runtime.Application app; Microsoft.SqlServer.Dts.Runtime.Package pkg; Microsoft.SqlServer.Dts.Runtime.Variables vars; Application integrationServices = new Application(); DTSExecResult result; FileName = FileName.Substring(FileName.Length - 25 , 25); app = new Microsoft.SqlServer.Dts.Runtime.Application(); pkg = app.LoadPackage(packagePath, null); //pkg = integrationServices.LoadFromSqlServer("Customer File Import.dtsx", "", "healthtech\\brian.montfort", "Nightdragon8", null); vars = pkg.Variables; if (pkg.Variables.Contains("

net.tcp://localhost:80/MyService client/server errors while IIS is running - even though all Net.TCP

Hello, I am trying to create a simple WCF client/server solution in two Windows Forms projects, respectively.  I am using net.tcp binding on port 80 and have enabled the port sharing property.  My NET.TCP Port Sharing service is running.  I am using Windows 7 x64 and logged in as an administrator.  I've added my username to the smvchost configuration files, in both Framework and Framework 64 directories. I also have IIS running on port 80. However, there seems to be a conflict between net.tcp on port 80 and IIS on port 80 simultaneously.  My understanding was that the Net.TCP Port Sharing is supposed to be the solution for this very scenario. Here are the specific issues: 1.  I start the server in debug mode, which works fine.  I then try to connect with the client, and get the error: "You have tried to create a channel to a service that does not support .Net Framing.  It is possible that you are encountering an HTTP endpoint".  This seems to imply that the NET.TCP Port Sharing is not forwarding the request to my WCF server, and instead is encountering IIS.  This is the first problem. 2.  The second issue is that the Server starts fine in Visual Studio in debug mode, however when I try to run it as a compiled EXE (and right-click - run as admin) it errors "The TransportMana

SharePoint 2010 AD FS 2.0 Integration - login works then fails, looping back to the adfs server

Hello, I setup SharePoint 2010 Claims auth with AD FS 2.0 following this post: http://blogs.technet.com/b/speschka/archive/2010/07/30/configuring-sharepoint-2010-and-adfs-v2-end-to-end.aspx.  I have no access to the ADFS server, but I think they followed the steps as outlined.  If I do an iisreset (or just recycle the app pool of the SharePoint site) I can login successfully using the remote credentials.  Also I can under security in SharePoint search for and find users and roles from the remote ADFS server. If I close my browser, open a new browser and go to the site I am prompted to login again (this is fine).  I do, using the same credentials, and the login fails because I am redirected between the SP and ADFS servers until the ADFS server stops the redirecting.  I have been doing some digging and I found this post: http://blogs.technet.com/b/speschka/archive/2010/08/09/setting-the-login-token-expiration-correctly-for-sharepoint-2010-saml-claims-users.aspx, which describes the situation I have in point # 3 at the bottom.  I have tried setting the token time out as low as 1 second but this hasn't helped. I have also, just to see, tried setting all the other lifetime settings to 1 second - but no luck.  Because the initial login works I think the setup is correct, but something is maintaining some state that is causing the loop

HttpWebRequest NTLM auth to secure server only works in .NET 4

Hi, I am trying to connect to a secure server via a proxy server which requires NTLM authentication, somewhat similar to http://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/a4aba6c5-6180-441e-ab60-95347fcdc051 The test app below fails with a 407 error when target framework is set to .NET 2, 3, or 3.5, but succeeds w/ .NET 4: static void Main(string[] args) { WebProxy myProxy = new WebProxy(); myProxy.Address = new Uri("http://testproxy.here.com:3121"); myProxy.Credentials = new NetworkCredential("proxyuser", "password", "testproxy.here.com"); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri("https://testserver.here.com/sessions")); request.Method = WebRequestMethods.Http.Post; request.ProtocolVersion = new Version("1.1"); request.Credentials = new NetworkCredential("username", "password"); request.Proxy = myProxy; allDone.Reset(); request.BeginGetResponse(new AsyncCallback(GetResponseCallback), request); allDone.WaitOne(); } private static void GetResponseCallback(IAsyncResult asynchronousResult) { HttpWebRequest httpWebRequest = (HttpWebRequest)asynchronousResult.AsyncState; HttpWebResponse httpWebResponse = null; try { if (httpWebRequest.HaveResponse == true) { httpWebResponse = (Htt

Unable to connect to Visual Studio's Localhost Web Server

I've been running Visual Studio 2005 for about three weeks now and everything has worked just fine. Now all of the sudden I'm getting this error "Unable to connect to Visual Studio's Localhost Web Server" Any ideas how I can fix it?

unable to connect to visual studio's localhost web server

Hello, I created a simple web page in Microsoft Visual Web Developer 2005 Express Edition.  Then I pressed Ctrl/F5. Build succeeded. Next I reseived an error message "unable to connect to visual studio's localhost web server". Does anybody know why?  

Problems with url rewriting when using the ASP.NET development server

I've inherited a website which has been developed for IIS server. The hyperlinks in this website have a href attribute with the human readable form that appears in the url in the browser's searchbar. In Application_BeginRequest(), there is a method which will convert this into the acutal location of the page within the website's file structure.This works fine when running the website on IIS. However, when I am using the ASP.NET development server, the links do not work and I get a page not found error.I have noticed that Application_BeginRequest() is never called for the links when run using the ASP.NET development server. I have read that the ASP.NET development server will not serve pages that are outside of the application scope (http://msdn.microsoft.com/en-us/library/58wxa9w5%28VS.80%29.aspx), as the human-readable urls would appear to be when first processed by the server.Bear in mind that the urls in the aspx files are in human readable form, so I can't just use ResolveUrl(), because they don't correspond to files in the internal file structure until they have been re-written.I want to get the website running on the ASP.NET development server so that I can test it locally on my machine, which I can't really do if I can't get the url re-writing to work. Is there a way around this problem?

MSDTC - TransactionOption "Required" works from my XP Workstation but not from our 2008 Server

I have a SSIS package (2008) that has a sequence container with TransactionOption Required.  This is needed to ensure that multiple tasks commit or fail together.  It also has a custom transformation that establishes (acquires) connection objects. This package works great when run from my local XP workstation.  I can see the distributed transaction starting and committing in the SSIS output. The problem is that when I roll this package out to the server, it fails to acquire the connection, throwing an error at Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSConnectinoMAnager100.AcquireConnection(Object pTransaction).  I've verified that the security settings of MSDTC on this server are consistent....they are definitely set to allow inbound and outbound. Are there any issues with MSDTC on Windows Server 2008?  Is it possible that I'm getting an issue because my workstation is 32 bit but the server is 64 bit? Thanks -Mark

Print control works on reporting server, but not in embedded in application

Hi,I am having an issue where if I click on the print icon in the report viewer embedded in an application, I get the error "unable to load client print control".  However, when running through report manager, this is fine.  I am running SQL Server 2005 SP3 and report viewer 9.Any thoughts would be much appreciated.

Problems deploying Report in Local Server (localhost)


OK, I'm kind of new to SQL Server 2008 and I'm having issues trying to deploy a report in my local server.


Basically, I installed SQL Server 2008 R2 in my personal desktop and because of this, I thought no Service Account were necessary since I was going to be the only one accesing it; anyway; I've created a set of reports and everything works fine; but when I try to deploy them, they won't go through.

I open a browser and type http:\\localhost\reportserver and it actually requests me for a password; the username is already populated, which is the name of my computer, but then for the password, I didn't set up any password for anything, during the installation and if I put my computer password, it doesn'y work either, after three attemps, the browser simply goes blank.

I'm sure this might be a very basic issue, but I've been trying to look for answer, online, through forums etc; and no good luck yet...


Thanks in advanced for all your help!



RijndaelManaged works on workstation, not on server


I have a project that uses the RijndaelManaged class for encryption/decryption.  It works fine on my workstation (xp 32-bit), but when it gets deployed to Windows 20008 Server (64-bit), it gives the following error:

"Specified key is not a valid size for this algorithm."


object (movie) not playing live - works on local


I have a small web app (using vb.net/asp.net) that I have created a control with an oject and I show a short video.  The video is a .mov file.  When I run the page on my local testing machine, it works just fine.  When I move the files to the server and test it, the movie just won't play.   There are no errors on the page or anything, the movie just won't play.  I know the path to the video is correct.  When I click play, it says 'Opening Media' for 1 or 2 seconds and then it goes back to the ready state.  I'm wondering why it works locally but not on the server.  Does the server need a media player?

Here's my control:

<object id="<%= ClientID %>_Player" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="<%= Me.Width %>" height="<%= Me.Height %>" style="margin:0px auto; z-index:10000">    
<param name="URL" value="<%= me.VideoUrl %>" />    
<param name="autoStart" value="false" />    
<param name="uimode" value="Full" />    
<%--<param name="autoplay" value="True" />--%>    
<embed id="<%= ClientID %>_Embed" type="application/x-mplayer2"

throw exception message giving internal server error on live site


using vb.net/asp.net 2005

when a user enters a bad email I am doing a check on this and throwing an exception message as follows, this works fine on the test site but for some reason the same code on the live site gives a "internal server error" (http code 500).  The code below:

            If isThisEmailValid(strEmailThatTheUserEntered) Then
		'do something


                Throw New Exception("You entered a bad email address.")

            End If

not certain why this is happening, I assume that it's some server or config difference between the test and live sites.  has anyone seen this before?  For a quick fix i'm registering javascript alert and showing the same text so it works but I would like to figure out why the code above is not working.

as always, thanks for your feedback


Roles on live server


Hey guys,

I am having a problem with role authentication on our production server. My configuration is working perfectly on my local system (using .net's inbuilt web server), however when deploying to the production server suddenly I get booted out of directories in which the role is allowed.

I am not using .net's membership/roles tables (aspnet_Membership, aspnet_Profile, aspnet_Users .... etc) But am using my own tables to login a user. I am adding the roles to the FormsAuthenticationTicket and have allowed certain roles to access certain directories under the "members" directory for example here is a snippet of my web.config under the members directory

<?xml version="1.0"?>
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
  <location path="UserManagement">

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend