EzDevInfo.com

iis-7 interview questions

Top iis-7 frequently asked interview questions

IIS - this configuration section cannot be used at this path (configuration locking?)

I've encountered an error deploying a site to a server. When trying to load the home page, or access authentication on the new site in IIS, I get the error:

Config Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

More detail can be found here, in Scenario 7 matches my hex error code.

The solution given on the linked site above is to set Allow for overrideModeDefault in the section mentioned in my error, in the applicationHost.config file. In my case, under Security in system.webServer. But if I look at the applicationHost.config on my local computer, where the site is properly deployed already, that section is set to Deny.

If this solution is correct, how is my local instance running just fine with the same web.config? According to my applicationHost.config, that section should be locked, but it's not. I'd prefer to not change the applicationHost.config file, because there are many other sites running on that server. Is there another solution?


Source: (StackOverflow)

Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive

I just installed vs 2010, followed by IIS in window 7. when building a website in .net framework 4.0 and convert this into application in IIS then its shows this error

enter image description here

If i remove the targetFramework="4.0" from web config file then it shows me a second error which is related to linq reference error

enter image description here

This all happening when i am using localhost to run my website but whenever i use just f5 in vs 2010 then its run perfectly.

When i want to attach my process with aspnet_wp.exe i don't find this process in my list.

I searched a lot of answers here. What am I missing.


Source: (StackOverflow)

Advertisements

How do I resolve "HTTP Error 500.19 - Internal Server Error" on IIS7.0

What causes this error, how can I fix it?

Detailed Error Information
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x8007052e
Config Error Can not log on locally to C:\inetpub\wwwroot as user administrator with virtual directory password
Config File Unavailable (Config Isolation)
Requested URL http://192.168.0.3:80/
Physical Path C:\inetpub\wwwroot
Logon Method Not yet determined
Logon User Not yet determined

Config Source

            <application path="/" applicationPool="PS-Extranet">
                <virtualDirectory path="/" physicalPath="%SystemDrive%\inetpub\wwwroot" userName="administrator" password="[enc:AesProvider:PrISRz2ggJH4bV46ktObfCSh91Y/yF9pAoLmH7eCnj0=:enc]" />
            </application>

Source: (StackOverflow)

How do I remove eTag headers from IIS7?

Per Yahoo's best practices for high performance web sites, I'd like to remove Etags from my headers (I'm manually managing all my caching and have no need for Etags... and when/if I need to scale to a farm, I'd really like them gone). I'm running IIS7 on Windows Server 2008. Anyone know how I can do this?


Source: (StackOverflow)

Invalid application path

IIS7 Windows 7 64bit

No matter what I do I can't seem to add an application to a web site.

When I 'Test settings' I get "Invalid application path".

Any one have a guess as to what I could be doing wrong?

screenshot


Source: (StackOverflow)

Is Enabling Double Escaping Dangerous?

I have an ASP.NET MVC application with a route that allows searching for stuff via /search/<searchterm>.

When I supply "search/abc" it works well, but when I supply "/search/a+b+c" (correctly url encoded) then IIS7 rejects the request with HTTP Error 404.11 (The request filtering module is configured to deny a request that contains a double escape sequence). FIrst of all, why does it do this? It only seems to throw the error if it is part of the URL, but not as part of a query string ( /transmit?q=a+b+c works fine).

Now I could enable double escape requests in the security section of my web.config but I'm hesitant to do so as I don't understand the implications, and neither why the server would reject the request "a+b+c" as part of the URL but accept as part of a query string.

Can someone explain and give some advice what to do?


Source: (StackOverflow)

Unable to start debugging on the web server. Could not start ASP.NET debugging VS 2010, II7, Win 7 x64

I am running Visual Studio 2010 (as Admin), IIS 7 on Windows 7 x64. I am able to run the ASP.NET web site in IIS 7 without debugging just fine, but when I press F5 to debug it, I get:

Unable to start debugging on the web server. Could not start ASP.NET debugging. More information may be available by starting the project without debugging.

Unfortunately the help link is not helping me much and leads down a heck of a large tree of things.

I checked the following:

  • Security requirements — I don't recall having to do anything special before. The worker process in IIS7 is w3wp.exe. It says that if it's running as ASPNET or NETWORK SERVICE I must have Administrator privileges to debug it. How do I find out if I need to change something here?

  • Web site Property Pages > Start Options > Debuggers > ASP.NET is checked. Use custom server is set to the URL of the site (which works fine without debugging).

  • Debugging is enabled in web.config.

  • Application is using ASP.NET 3.5 (I want to move to 4.0 eventually but I have some migration to deal with).

  • Application pool: Classing .NET AppPool (also tried DefaultAppPool).

Any ideas where I can check next?

Surely it shouldn't be that hard to install IIS, VS, create a web site, and start testing it?

Thanks in advance.


Source: (StackOverflow)

Avoid web.config inheritance in child web application using inheritInChildApplications

I am trying to add

<location inheritInChildApplications="false">

to my parent web application's web.config but it doesn't seem to be working.

My parent's web.config has:

<configuration>
    <configSections>
    </configSections>

    // 10 or so custom config sections like log4net, hibernate,

    <connectionStrings>
    </connectionStrings>

    <appSettings>
    </appSettings>

    <system.diagnostics>
    </system.diagnostics>

    <system.web>
         <webParts>
         </webParts>
         <membership>
         </membership>

         <compilation>
         </compilation>
    </system.web>

    <location ..>
    <system.web>
        </system.web>
    </location>

    <system.webServer>
    </system.webServer>

My child web application is setup as an application in IIS, and is inheriting from the parent's web.config which is causing problems.

Where exactly should I place the

<location inheritInChildApplications="false">

so it ignores all the various web.config settings?


Source: (StackOverflow)

IIS does not list a website that matches the launch url

I need to debug the website i 'm developing (ASP.NET MVC3, Razor, .NET 4, VS2010 SP1 (as administrator)) in IIS7 (Vista Home) and getting the error:

IIS does not list a website that matches the launch url.

To test if it has to do something with the settings of the app, i did create from scratch an empty new ASP.NET MVC3 website, set for IIS, created virtual directory, launched with F5 and i worked fine!

I again did create a second website project with the exact same settings (just to be sure) and this also launched as expected.

This leads my to think that i have some configuration problem!? But what? In the past i used IIS very rare, so my knowledge is somehow limited in this direction.

Any hints?


Source: (StackOverflow)

Set Default Page in Asp.net

Is there any section or code which allows us to set default page in web.config ?

For example, when people first visit my website, I want them to see CreateThing.aspx rather than Default.aspx.

The solutions I know :

  1. Put this line of code => Response.Redirect("CreateThings.aspx") in Default.aspx Page_Load event but this method is really naive.

  2. We can use IIS (default page configuration) but I wanna do the same thing over Asp.NET application.

If you know a better solution, please let me know.

Thanks in advance.

P.S : The reason why I am asking about Web.Config is I believe Web.Config would help us through this.

Edit: I am just wondering how Microsoft .NET team forgot such a simple thing :)

Edit :

This could be another solution for now :

<defaultDocument>
    <files>
        <clear />
        <add value="Default.aspx" />
        <add value="Default.htm" />
        <add value="Default.asp" />
        <add value="index.htm" />
        <add value="index.html" />
        <add value="iisstart.htm" />
    </files>
</defaultDocument>

Source: (StackOverflow)

How to configure static content cache per folder and extension in IIS7?

I would like to set up rules in IIS7 for static content caching in my ASP.NET website.

I have seen these articles, which details how to do it using the <clientCache /> element in web.config:

Client Cache <clientCache> (IIS.NET)
Add Expires or Cache Control Header to static content in IIS (Stack Overflow)

However, this setting appears to apply globally to all static content. Is there a way to do this just for certain directories or extensions?

For example, I may have two directories which need separate cache settings:

/static/images
/content/pdfs

Is it possible to set up rules for sending cache headers (max-age, expires, etc) based on extensions and folder paths?

Please note, I must be able to do this via web.config because I don't have access to the IIS console.


Source: (StackOverflow)

System.Security.SecurityException when writing to Event Log

I’m working on trying to port an ASP.NET app from Server 2003 (and IIS6) to Server 2008 (IIS7).

When I try and visit the page on the browser I get this:

Server Error in ‘/’ Application.

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application’s trust level in the configuration file.

Exception Details: System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and the location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.]

System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly) +562 System.Diagnostics.EventLog.SourceExists(String source, String machineName) +251

[snip]

These are the things I’ve done to try and solve it:

  1. Give “Everyone” full access permission to the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Security. This worked. But naturally I can’t do this in production. So I deleted the “Everyone” permission after running the app for a few minutes and the error re-appeared.

  2. I created the source in the Application log and the Security log (and I verified it exists via regedit) during installation with elevated permissions but the error remained.

  3. I gave the app a full trust level in the web.config file (and using appcmd.exe) but to no avail.

Does anyone have an insight as to what could be done here?

PS: This is a follow up to this question. I followed the given answers but to no avail (see #2 above).


Source: (StackOverflow)

Problem in running .net framework 4.0 website on iis 7.0

Hey I got problem in running .NET framework 4.0 website on IIS7.0. the error I got is like:

HTTP Error 404.2 - Not Found "The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server".

Module : IsapiModule , 
Notification : ExecuteRequestHandler, 
Handler : PageHandlerFactory-ISAPI-4.0_32bit , 
Error Code : 0x800704ec

Source: (StackOverflow)

IIS7: HTTP->HTTPS Cleanly

Is there a clean way to redirect all attempts to going to an HTTP:// version of a site to its HTTPS:// equivalent?


Source: (StackOverflow)

How to disable the application pool idle time-out in IIS7?

Will it be disabled if I set the idle time-out to 0?


Source: (StackOverflow)