Rectangle 27 2

  • Check the .NET version of the app pool (e.g. 2.0 vs 4.0)
  • Check that all IIS referenced modules are installed. In this case it was the AJAX extensions (probably not the case these days), but URL Rewrite is a common one.

iis - Web Application Problems (web.config errors) HTTP 500.19 with II...

asp.net iis web-applications web-config iis-7.5
Rectangle 27 2

  • Check the .NET version of the app pool (e.g. 2.0 vs 4.0)
  • Check that all IIS referenced modules are installed. In this case it was the AJAX extensions (probably not the case these days), but URL Rewrite is a common one.

iis - Web Application Problems (web.config errors) HTTP 500.19 with II...

asp.net iis web-applications web-config iis-7.5
Rectangle 27 1

Yes you dont need to install asp.net mvc3 on the server. The server I'm using don't have Visual Studio on it. You just need a proper server configuration. Apparently there are several reasons that results to 403 and 404 error. 403 - Forbidden 403.1 - Execute access forbidden. 403.2 - Read access forbidden. 403.3 - Write access forbidden. 403.4 - SSL required. 403.5 - SSL 128 required. 403.6 - IP address rejected. 403.7 - Client certificate required. 403.8 - Site access denied. 403.9 - Too many users. 403.10 - Invalid configuration. 403.11 - Password change. 403.12 - Mapper denied access. 403.13 - Client certificate revoked. 403.14 - Directory listing denied. 403.15 - Client Access Licenses exceeded. 403.16 - Client certificate is untrusted or invalid. 403.17 - Client certificate has expired or is not yet valid. 403.18 - Cannot execute requested URL in the current application pool. This error code is specific to IIS 6.0. 403.19 - Cannot execute CGIs for the client in this application pool. This error code is specific to IIS 6.0. 403.20 - Passport logon failed. This error code is specific to IIS 6.0.

404 - Not found. 404.0 - (None) File or directory not found. 404.1 - Web site not accessible on the requested port. 404.2 - Web service extension lockdown policy prevents this request. 404.3 - MIME map policy prevents this request. For the solution Check this link here. I found that link very useful. I hope it will also help you. :)

Does ASP.NET MVC have to be installed on the deployment target machine...

asp.net asp.net-mvc asp.net-mvc-3 deployment web-deployment
Rectangle 27 1

IIS can often be confusing and frustrating, even if you know how the underlying protocols and systems work. First, you can't have a web site on the internet at a particular path. The host name (and/or IP address and port) determines the server that controls the site. Paths are simply a convenient organizational tool within a site. Given this restriction, IIS naturally requires that you create something that listens at the hostname (again, and/or IP address and port) level. IIS calls this a "site". Once you've created your site, you can create an application or virtual directory within that site. The only difference between an application and a virtual directory is that an application can run its own code in its own application pool. Either one is always handles a subpath of its parent (which is either the site or another virtual directory or application). This is because of how IIS processes the request. After finding the appropriate application for the request by using the IP address, port, and hostname, it sends the request to the application. The application then looks at the first part of the path given in the request and uses that to find the appropriate application or virtual directory, which then does the same thing with the next part of the path until it cannot match the next subpath part to a configured application or virtual directory. If the last item found is a virtual directory, it just serves up the static files at the configured physical path. If it's an application, it passes control to the code for the application if there is any. If there is no code for the application, it treats the application as if it were just a virtual directory.

When you're setting up your own website, you can either use the preconfigured 'Default Web Site', which listens to port 80 on all IP addresses, or a site you create yourself. However, keep in mind that IIS can easily get confused if you try to create two items that listen to the same URL, so if you create your own site that attempts to listen to the same URL as the default web site, it won't work. You may need to disable (or delete) the default web site first, by right-clicking on the site and choosing Manage Web Site/Stop.

Application Pools can be thought of as crash protection boundaries. Applications in one pool are protected from crashes in other pools. By default, an application pool is created for each new site, and is named the same as the site (so each site is protected from other sites). You can override the default application pool mapping during site creation or afterwards.

When troubleshooting or first setting up a system, it's usually a good idea to first get the site working (and make sure you're hitting the site you think you're hitting), then add the applications one at a time and get each of those working (without messing with the site). If you have code at any of the levels, first test it without the code and then test it with the code. If the static files succeed but the code doesn't, it may be an application pool settings issue. Test it from the local machine first, then from another machine (if needed). If it works locally, but not from another machine, it's probably a firewall or network issue.

Reading through what you have written it seems that if I have an IIS application at 'WebSite1/Application1' that I need something to exist at 'WebSite1' that fowards all './Application1' urls to Application1. Is there nothing straightforward that can do this? If not how is IIS supposed to serve more than one website, or is it only intended to serve one website?

According to this stackoverflow.com/a/6297660/954927 I should be able to add multiple sites under inetpub/wwwroot and access them as localhost/website1 localhost/website2 etc. But when I set up IIS in this way with a simple static file at wwwroot/website1 and wwwroot/website2 and navigate to localhost/website1 I get an error which indicates the request is being routed to inetpub\wwwroot\index.html which cannot be found.

On a given server, you can set up as many sites as you like. In a given site, you can set up as many applications as you like, and on a given application, you can set up as many virtual directories as you like.

Where are the files you're trying to serve up and how did you configure IIS to point to that directory?

The site can be completely empty (in this case, it just acts as a holder for applications). The same also holds true for applications (in which case they're basically just a virtual directory).

asp.net - How do i get IIS to make a website available at a specified ...

asp.net iis
Rectangle 27 0

<system.webServer>
    ...
    <handlers accessPolicy="Read, Script">
      ...
      <remove name="StaticFile" />
      <add name="ASP.NET-ISAPI-2.0-Wildcard"
         path="*" verb="GET,HEAD,POST,DEBUG"
         modules="IsapiModule"
         scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"
         preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
      <add name="StaticFile" 
         path="*" verb="*" 
         modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" 
         resourceType="Either" requireAccess="Read" />
    </handlers>
    ...
</system.webServer>

I have added the given code in my web.config, after that it gives the 500 Internal server error...

Probably an error in your config, did you add it into <system.webServer>? Can you post what you have? Sorry just realised I gave you wrong link as well, I'll fix.

have a look a the error message, or post your config.

just realised in your question you refer to .net 2.0, routing is only available in 3.5 SP1 - are you using that?

.net 3.5 - URL Routing is not working in IIS 7.0 witrh apllication poo...

asp.net .net-3.5 iis-7 url-routing application-pool
Rectangle 27 0

I hope I've understood your question correctly, but please do let me know if I haven't.

It sounds like the sole issue you have is that when you write the links to the response they sometimes reference the wrong root URL.

I notice that you use ~/ . This would resolve and write the entire URL to the response I think. It is better to use only / when writing links to the response.

So in your example you would write /myfolder/mypage.aspx. The browser would then resolve the / to mean that it's from the root address of the site, whichever that may be.

Thanks for commenting "The Bearded Llama" :) - Your suggestion is only a work-around. I am able to resolve my links in a similar way, but I am more interested on figuring out why IIS is doing this and how to prevent it, rather then working around it. I've add URL rewrites to help with the issue, but I sure wish I knew how to prevent it.

Well, it's not really a workaround, it's more keeping with DRY as well as not hardcoding things. Although, now I understand what your question was about. It sounds like it's an IIS setup issue. If you post your IIS setup, I'll be more than happy to have a look and try to help.

asp.net - IIS app pool caches wrong url - Stack Overflow

asp.net iis-7
Rectangle 27 0

I know it's a long shot, but I've had a similar problem with my IIS setup. I solved it by going to the already mentioned "bindings" window through "Edit Bindings".

Then I removed all the not wanted bindings, then adding the hostname www.mydomain.com the server should answer to.

%windir%\System32\drivers\etc\hosts
127.0.0.1 www.mydomain.com

This ensures that www.mydomain.com always resolves to the local computer.

After executing iisreset.exe as administrator my problem was over.

asp.net - IIS app pool caches wrong url - Stack Overflow

asp.net iis-7
Rectangle 27 0

In order to route to an extensionless target like /content/something you need to use Integrated Mode in the IIS application pool. If you cannot change this, then there's no easy way to do what you want, other than setting up a custom 404 handler, and manually dealing with the URL from there. This is probably the cause of your 404 errors.

Also, RouteExistingFiles should probably be false. You are trying to route things that don't exist as files. If you set RouteExistingFiles = true then the default handling for files that exist will NOT be used when a route matches. All you want to do is deal with paths that don't exist, but represent content from a database, right? So leave this false.

MapPageRoute
routes.MapPageRoute("SalesRoute",
    "SalesReport/{locale}/{year}",
    "~/sales.aspx");

That would cause matching routes to invoke sales.aspx in response. In your example, the target is ~/about/company which looks like a route, not an actual target - your actual target that handles the CMS request should have an aspx extension.

c# - Routing to virtual item - Stack Overflow

c# asp.net .net asp.net-routing
Rectangle 27 0

Yes you dont need to install asp.net mvc3 on the server. The server I'm using don't have Visual Studio on it. You just need a proper server configuration. Apparently there are several reasons that results to 403 and 404 error. 403 - Forbidden 403.1 - Execute access forbidden. 403.2 - Read access forbidden. 403.3 - Write access forbidden. 403.4 - SSL required. 403.5 - SSL 128 required. 403.6 - IP address rejected. 403.7 - Client certificate required. 403.8 - Site access denied. 403.9 - Too many users. 403.10 - Invalid configuration. 403.11 - Password change. 403.12 - Mapper denied access. 403.13 - Client certificate revoked. 403.14 - Directory listing denied. 403.15 - Client Access Licenses exceeded. 403.16 - Client certificate is untrusted or invalid. 403.17 - Client certificate has expired or is not yet valid. 403.18 - Cannot execute requested URL in the current application pool. This error code is specific to IIS 6.0. 403.19 - Cannot execute CGIs for the client in this application pool. This error code is specific to IIS 6.0. 403.20 - Passport logon failed. This error code is specific to IIS 6.0.

404 - Not found. 404.0 - (None) File or directory not found. 404.1 - Web site not accessible on the requested port. 404.2 - Web service extension lockdown policy prevents this request. 404.3 - MIME map policy prevents this request. For the solution Check this link here. I found that link very useful. I hope it will also help you. :)

Does ASP.NET MVC have to be installed on the deployment target machine...

asp.net asp.net-mvc asp.net-mvc-3 deployment web-deployment
Rectangle 27 0

Ok, I seem to have fixed things on my own. Originally I had both my websites set up in IIS under the same App Pool. I separated them into different app pools, made sure they were both set to .Net 4, and everything started working. Now when users are redirected from one domain to another, the eurl.axd/GUID does not get tacked on to the end of the URL.

asp.net mvc - IIS 6 Extensionless URLs - Stack Overflow

asp.net-mvc iis-6
Rectangle 27 0

In integrated mode, IIS App pools allow Any request URL to come in to the ASP.NET ISAPI, however, in classic mode, you would need a third-party ISAPI or the request will be sent directly to the page.

In integrated, the module gets checked FIRST before the actual request content.

asp.net - Custom HttpModule working in IIS7 integrated, but not classi...

asp.net .net iis-7 httpmodule
Rectangle 27 0

Personally, I havent tried log4net but seen the specs and examples for winforms, but my organization coded our own logging mechanism that reports and logs errors that are caught in the global.asax that reports everything we need to know about the stack trace, session (if exists), form's NVC, version of the app, URL that originated the error with querystring, and HTTP headers. Though I noticed that not all errors get logged there; such as forms authentication expiration or application pool restart/shutdown or anything reported by IIS that was not thrown by the application executing.

ASP.NET Logging - log4net or health monitoring? - Stack Overflow

asp.net logging log4net health-monitoring
Rectangle 27 0

This is more generic configuration as you can write it once in the URL Rewrite of the root IIS (not specific to a certain application pool) and it will automatically be applied to ALL your IIS websites without any dependency on your domain name.

url - remove 'WWW' in ASP.NET MVC 1.0 - Stack Overflow

asp.net-mvc url
Rectangle 27 0

I had this very problem and finally found a solution. I had to add a configuration to the web.config to tell it where to find the default proxy. This is because the client ID that my app pool is using doesn't have security rights to find it on the system that it is running on. So, it's trying to go to the url directly rather than being routed through the proxy thereby preventing it from connecting. In my situation, our IIS server uses a script for it's proxy but this is also the solution needed if you have a proxy server.

<configuration>
  <system.net>
    <defaultProxy>
      <proxy scriptLocation="http://pac.MyDomain.com/" />
    </defaultProxy>
  </system.net>
</configuration>
<configuration>
  <system.net>
    <defaultProxy>
      <proxy proxyaddress ="http://contoso:8080" />
    </defaultProxy>
  </system.net>
</configuration>

There are other options with the proxy element that may help you as well including: bypasslocal and usesystemdefault but I'm not entirely sure what they do.

c# - Unable to connect to the remote server - Stack Overflow

c#
Rectangle 27 0

HttpContext.Current.Request.Url is not a cacheable item. That value comes from the HOST value of the HTTP headers. Which means it is passed in to the application from the request.

The only time it should take that second URL is if the requests HOST value was masdfg.my.provider.net

There are three possible fixes here. The first is to set your bindings and have any requests to masdfg.my.provider.net be forwarded over to www.mysite.com

The second, because your primary issue appears to be about SSL is to get a unified communications (UC) SSL certificate and install that on your server. This would be to cover the mysite.com and masdfg.my.provider.net domain names.

The third is to simply create a separate IIS site which points to the exact same production directory as the first one. Each site would have only 1 domain name it's responsible for.

asp.net - IIS app pool caches wrong url - Stack Overflow

asp.net iis-7
Rectangle 27 0

The IIS 7.5 URL Rewrite 2 Module is capable of URL Rewriting / URL Rewriting regardless whether the application pool runs under the classic or integrated pipeline mode.

Tks, Ive seen something about URL Rewriting, but Id like to try using only .Net framework, to keep things simpler. Anyway, tks a lot..

I don't understand your point. Give me one valid reason, why you don't want to use an official nice and clean way to rewrite/redirect urls? iis.net/download/urlrewrite

You were right. I thought it was a third party product. Thanks..

iis 7 - URL Routing in ASP.Net webforms running under the Classic .NET...

asp.net iis-7 url-routing
Rectangle 27 0

Just some simple ideas of how to resolve it. Hope they are usefull. a) Check the app pool of the application. Set it to the correct .NET framework if required. b) A very simple test I perform to see if its the app or the url. - Stop the app. - Place your app in a folder temporarily. - Place a simple index.html HTML file where your app should be. - Browse to it and see if 404 shows. c) if its a new box and not set correctly you might need to set up IIS for Application Development. Check this Link with regards to setting it up. Expand the tree to make sure you select what you need.

I checked and the asp.net is installed in the server. I also tried to do a simple html file and placed on the folder as you said and I still got a 404 error of file not found.

So it is easy to deduce that this isn't a publishing problem, nor a mvc problem. It is an IIS issue. do you get the default IIS splash screen when u navigate to the box? Have you checked the firewall rules? Are there any proxies you need to look at and configure?

No proxy. Firewall rule por the app specific port in windows server is created and I do get the iis splash screen if I navigate to the root

c# - publish .net mvc to a remote windows server - Stack Overflow

c# .net asp.net-mvc visual-studio-2013 iis-7
Rectangle 27 0

In integrated mode, IIS App pools allow Any request URL to come in to the ASP.NET ISAPI, however, in classic mode, you would need a third-party ISAPI or the request will be sent directly to the page.

In integrated, the module gets checked FIRST before the actual request content.

asp.net - Custom HttpModule working in IIS7 integrated, but not classi...

asp.net .net iis-7 httpmodule
Rectangle 27 0

I would assume that you are trying to write to the file system from your application. In that case the "C" comes from the server. ASP.Net and IIS know where your application resides on the server and are mapping the path from the URL to the file system (C:). It works when you start things from Visual Studio because it's being run under an account that has write permissions to the file system. The IIS Application Pool User that is running on your server does not have write permissions. To resolve this issue you can give that user write permissions. You can see how to do that in this post.

c# - Relativ paths in class library for asp.net application - Stack Ov...

c# asp.net path class-library
Rectangle 27 0

Another distinction I noticed is that Cassini runs as a 32-bit process and you have no control over it, whereas you can control the application pool of your IIS app to disallow 32-bit (assuming your IIS is running on a 64-bit server). This becomes especially important if your web application is going to call APIs in 64-bit processes such as SharePoint Foundation/Server 2010. When you debug your web app with Cassini as your debug server, you'll get "The Web application at url could not be found. Verify that you have typed the URL correctly" type errors when instantiating objects. If you debug using IIS with the app running in an app pool that runs as 64-bit with an identity that allows access to sharepoint database then you'll be able to debug properly.

ASP.NET Development Server or Localhost IIS? - Stack Overflow

asp.net iis localhost cassini