EzDevInfo.com

iis-6 interview questions

Top iis-6 frequently asked interview questions

Asp.net mvc 4 on iis6: "The page cannot be found"

I am having trouble getting ASP.Net MVC 4 running on IIS 6.

First, i got "Directory listing denied" and that already solved after I setup extensionless urls based on Phil Haack's blog post: ASP.NET MVC on IIS 6 Walkthrough.

Now, I'm getting "The page cannot be found" 404 page.

It's a simple ASP.Net Web Api project in MVC 4 beta.


Source: (StackOverflow)

What does an IISReset do?

On IIS 6, what does an IIS Reset do?

Please compare to recycling an app pool and stopping and starting an ASP.NET web site.

If you replace a DLL or edit/replace the web.config on an ASP.NET web site is that the same as stopping and starting that web site?


Source: (StackOverflow)

Advertisements

Mailbox unavailable. The server response was: 5.7.1 Unable to relay for abc@xyz.com

I am getting "Mailbox unavailable. The server response was: 5.7.1 Unable to relay for abc@xyz.com" when I try to send the mail using ASP.NET. The site is deployed on IIS7, Windows 2008 server.

The website was working fine on IIS6 and Windows 2003 Server. I deployed it on IIS7, 2008 it has started giving me this error.

Has anybody experienced this before?


Source: (StackOverflow)

Get IIS6 to serve JSON files (inc. POST,GET)?

By default, IIS6 does not serve .json (no wildcard MIME type).

Therefore a 404 not found is thrown. I then add a new MIME type (.json, text/plain or application/x-javascript or application/json) which works fine.

However, when you then add a new mapping (Home Directory -> Configuration -> Add) with .json, C:\WINDOWS\system32\inetsrv\asp.dll, "GET,POST" and try to browse to the file, you get a 404.

If you remove the mapping and try and POST or GET to it, you get a 405.

...

Suggestions?


Source: (StackOverflow)

What might be causing the"The client disconnected" ASP.NET exception?

My .NET 3.5 application sporadically throws the following exception System.Web exception:

The client disconnected

Any ideas why this exception is occurring? My application is running on a load balanced Windows Server 2003 IIS 6.0 server.


Source: (StackOverflow)

Programatically create a web site in IIS using C# and set port number

We have been able to create a web site. We did this using the information in this link:

http://msdn.microsoft.com/en-us/library/ms525598.aspx

However, we would like to use a port number other that port 80. How do we do this?

We are using IIS 6


Source: (StackOverflow)

How can I determine which w3wp.exe process belongs to which web site?

I have an IIS6 web server that is hosting two application pools. Occasionally, one of the w3wp processes will spike the CPU for a while, and both app pools seem to suffer the consequences. I'm not sure which one is which, and without that information I don't know which application to blame.

How can I tell which w3wp belongs to which App Pool?


Source: (StackOverflow)

ASP.NET MVC3 and Windows Auth on IIS keeps redirecting to /Account/Login

I'm running MVC3 and a windows auth web application. When I deploy to IIS6 it runs great until I hit a page that requires authentication. It then is auto-redirecting to /Account/Login when I have no trace of that in my application and my web.config is configured to windows auth.

Any ideas?

Here is my entire web.config file: http://pastie.org/1568510


Source: (StackOverflow)

Display custom error page when file upload exceeds allowed size in ASP.NET MVC

My main issue is that I want to display an custom error page when an uploaded file exceeds allowed size (maxRequestLength in web.config).

When the big file is uploaded an HttpException is thrown before my upload action method in the controller is invoked. This is expected.

I have tried to catch the exception in a custom attribute and also to override OnException in the controller. Why isnt it possible to catch the exception in either the attribute or the OnException method?

Its possible though to catch the exception in Application_Error in global.asax but neither Response.Redirect nor Server.Transfer works for redirecting to the custom error page. Server.Transfer gives the "failed to process child request" error and response.redirect gives the "Http headers already sent" error.

Any ideas?

Thanks in advance!

Marcus


Source: (StackOverflow)

ASP.NET MVC on IIS6

Where can I find some good pointers on best practices for running ASP.NET MVC on IIS6?

I haven't seen any realistic options for web-hosts who provide IIS7-hosting yet. Mostly because I don't live in the U.S.

So I was wondering on how you best build applications in ASP.NET MVC and make it easily available to deploy on both IIS6 and IIS7. Keep in mind that this is for standard web-hosts, so there is no access to ISAPI-filters or special settings inside IIS6.

Are there anything else one should think about when developing ASP.NET MVC-applications to target IIS6? Any functions that doesn't work?

UPDATE: One of the bigger issues is the thing with routes. The pattern {controller}/{action} will work on IIS7, but not IIS6 which needs {controller}.mvc/{action}. So how do I make this transparent? Again, no ISAPI and no IIS-settings, please.


Source: (StackOverflow)

What causes an HTTP 405 "invalid method (HTTP verb)" error when POSTing a form to PHP on IIS?

I have one form in a PHP (5.2.9-1) application that causes IIS (Microsoft-IIS/6.0) to throw the following error when POSTed:

The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.

It's an HTTP 405 status code. All other forms in the application work, so I believe that the IIS 'verbs' setting for PHP pages is correct.

This is a customer's server, which I have no access to for verifying settings or testing code. All I can do is send the customer replacement files. Other customers on IIS servers have no such issue.

The form is perfectly straightforward:

<form method="post" action="index.php">
    ... fields ... 
</form>

What can cause IIS to throw that error on one form only, but work fine on others?


Source: (StackOverflow)

How can I programmatically stop or start a website in IIS (6.0 and 7.0) using MsBuild?

I have Windows Server 2003 (IIS 6.0) and Windows Server 2008 (IIS 7.0) servers, and I use MSBuild for deploying web applications.

I need to do a safe deploy, and do this:

  1. Stop a website in IIS 6 (or an Application in IIS 7), not stop AppPool.

  2. Check if the website is stopped; not running.

  3. If the website is stopped, do another task for deploy.

  4. Start the website IIS 6 (or Application in IIS 7),

How can I achieve this?

Update: Key for me: IIS6WebSite and IIS6AppPool (and for IIS7), do wait for stopped status when try Stop Website or AppPool?

When I execute Stop Action for Website (or Stop Action for AppPool), I need be sure 100% that Website is stopped, and then, and only if Website is Stopped, I can execute other targets.


Source: (StackOverflow)

How do I recycle an IIS AppPool with Powershell?

I haven't really done any Windows scripting at all, so I am at a loss on how to pull this one off. Anyway, basically what we want to do is have a script that will take an argument on which IIS AppPool to recycle. I have done some research on Google and haven't had much success on getting things to work.

Here is what I am trying now:

$appPoolName = $args[0]
$appPool = get-wmiobject -namespace "root\MicrosoftIISv2" -class "IIsApplicationPools" Where-Object {$_.Name -eq "W3SVC/APPPOOLS/$appPoolName"}
$appPool.Recycle()

and the error I get:

Get-WmiObject : A parameter cannot be found that matches parameter name '$_.Name -eq "W3SVC/APPPOOLS/$appPoolName"'.

Anyway, it would be nice if I also knew how to debug things like this. I already fixed one bug with the original script by doing gwmi -namespace "root\MicrosoftIISv2" -list. Any other tips like that one would be great.

Thanks!

Update: Here is some more info

$appPool = gwmi -namespace "root\MicrosoftIISv2" -class "IISApplicationPools" | Get-Member

.   TypeName: System.Management.ManagementObject#root\MicrosoftIISv2\IIsApplicationPools

Name                MemberType   Definition
----                ----------   ----------
Caption             Property     System.String Caption {get;set;}
Description         Property     System.String Description {get;set;}
InstallDate         Property     System.String InstallDate {get;set;}
Name                Property     System.String Name {get;set;}
Status              Property     System.String Status {get;set;}
__CLASS             Property     System.String __CLASS {get;set;}
__DERIVATION        Property     System.String[] __DERIVATION {get;set;}
__DYNASTY           Property     System.String __DYNASTY {get;set;}
__GENUS             Property     System.Int32 __GENUS {get;set;}
__NAMESPACE         Property     System.String __NAMESPACE {get;set;}
__PATH              Property     System.String __PATH {get;set;}
__PROPERTY_COUNT    Property     System.Int32 __PROPERTY_COUNT {get;set;}
__RELPATH           Property     System.String __RELPATH {get;set;}
__SERVER            Property     System.String __SERVER {get;set;}
__SUPERCLASS        Property     System.String __SUPERCLASS {get;set;}
ConvertFromDateTime ScriptMethod System.Object ConvertFromDateTime();
ConvertToDateTime   ScriptMethod System.Object ConvertToDateTime();
Delete              ScriptMethod System.Object Delete();
GetType             ScriptMethod System.Object GetType();
Put                 ScriptMethod System.Object Put();


gwmi -namespace "root\MicrosoftIISv2" -class "IISApplicationPools"


__GENUS          : 2
__CLASS          : IIsApplicationPools
__SUPERCLASS     : CIM_LogicalElement
__DYNASTY        : CIM_ManagedSystemElement
__RELPATH        : IIsApplicationPools.Name="W3SVC/AppPools"
__PROPERTY_COUNT : 5
__DERIVATION     : {CIM_LogicalElement, CIM_ManagedSystemElement}
__SERVER         : IRON
__NAMESPACE      : root\MicrosoftIISv2
__PATH           : \\IRON\root\MicrosoftIISv2:IIsApplicationPools.Name="W3SVC/A
                   ppPools"
Caption          :
Description      :
InstallDate      :
Name             : W3SVC/AppPools
Status           :

Source: (StackOverflow)

Avoiding 401 response for each request using NTLM

We have here an asp.net 3.5 application using NTLM based windows authentication. The system runs on a private network that actually distributed over different geographic places (connected via VPN).

We are now trying to optimize the website's performance. Because the way NTLM works, every new request to the IIS is composed with 3 different requests while the first 2 is 401 responses. We are trying to minimize the amount of these requests to be only at the beginning of the session. We found this solution. Unfortunately it didn't change anything and we keep getting this 401 response (which consumes time).

In order to see the traffic i first used the Fiddler app. Somehow, when I use Fiddler, there is only 1 authentication process at the beginning of the session (exactly as I wish), but when I close Fiddler and check the traffic via WireShark I can see that I still have this 401 response for each request.

The used clients are IE6, IIS version 6.

Can someone advise?


Source: (StackOverflow)

How can you get a .NET 4.5 website to run on IIS6?

I've got an old Windows 2003 server running IIS 6, and I chose .net 4.5 for my latest web app. Problem is I can't get it to run on the server...

.NET 4.0 framework is installed. I've run aspnet_regiis and deployed the website. I gave it it's own application pool. But I'm getting the following error:

The 'targetFramework' attribute in the <compilation> element of the Web.config 
file is used only to target version 4.0 and later of the .NET Framework (for 
example, '<compilation targetFramework="4.0">'). The 'targetFramework' attribute
currently references a version that is later than the installed version of the 
.NET Framework. Specify a valid target version of the .NET Framework, or install 
the required version of the .NET Framework.

I saw the requirements for .NET 4.5 as requiring Windows Server 2008 or later, but I'm seeing lots of posts with people just needing to configure the routing for MVC4 so it seems like this should be possible.

So any ideas what I need to do in order for this to work?

EDIT: The strange thing is we are using an ASP.NET Web API site that works just fine... but that should require .net 4.5...


Source: (StackOverflow)