IIS 7.0 with pipeline mode = Integrated doesn´t load any image/css in ASP .NET - asp.net

I have a full system working in IIS 5.1 ...
I migrated to IIS 7.0 with pipeline mode classic all works fine, but with pipeline Integrated my images/css are not loaded...
I´m using ASP.NET 3.5 with a Web Application...
Any help?

In IIS 7 when you install the ASP.NET modules, static content is not installed by default. You will need to go into programs and features, then "Turn windows features on or off".
Under IIS section, drill down into WWW services, Common Http features, and check "Static Content".
Without that css, images, html, and other non-dynamic content will not show up.

I was having the same issue, my static content was not installed. To change the setting under server 2008, get to Server Manager, open Roles and click Web Server (IIS). Once it populates find the Role Services section then Add Role Services to install the Static Content.

You can use some HTTP sniffing tool (Firebug or Fiddler) and check for failing requests. If you find such requests you can inspect the error message returned by the server.

I also found this to be a side effect of having a corrupted default document inheritance. We typically add "login.aspx" to the top of a the default documents list in the parent (Default Web Site) configuration. When this somehow became corrupted displaying this same symptom.
The fix was to remove the inherited value and re-add it. I could then see static content again using a .NET 4.0 integrated app pool.

Related

Using IIS Server instead of IIS Express in Visual Studio 2015

How can we configure our already developed ASP.Net website to use IIS Server instead of using IIS Express in VS2015?
IIS Express is the default server in Visual Studio 2015. My website runs fine with ASP.NET web Development server in Visual studio 2012 but when i run it in VS2015 , it does not loads the css and images .
So, i want to run it with IIS Server and not IIS Express in VS2015. Can anyone help me out ?
Project Properties -> Web -> Servers -> Change IIS Express to Local IIS -> Check Apply server settings to all users -> then Project URL to http://localhost/Example (your project)
Then build your project.
The problem with loading the CSS and Images is likely because of the paths you have used, not with the web host.
"/Images/Image1.jpeg" always looks for an Image subfolder with an Image1.jpg in the same place as the current page.
"~/Images/Image1.jpeg" will look for an Images folder with an Image1.jpg starting from the site root. Using the tilde (~) is going to address other things as well (user controls, pages in folders, etc.
The same holds true for stylesheet hrefs. If you want to diagnose this kind of "resource failing to load" problem, you can use the developer tools (IE, Chrome, FireFox/FireBug, Safari all have them) and start a capture on the network tab. That will list a request to each resource (image, css, js, etc) and what the request path and HTTP status (404 - not found, 200 - OK, etc) is.
EDIT: Aside from the above which is directed to help you find the source problem of not loading CSS and Images, you will have to do a few things.
Create an application in your local IIS's Default Web Site that points to your project's root.
Make sure the Build and Start Options tabs are set correctly in the website project properties. Be sure to set the "Use custom web server" value with the URL you created in local IIS.
At that point you should be able to Start Debugging, but you should really consider conversion to a Web Application if you want a less fragile program and an easier development experience.
Key differences between WS/WAP - https://msdn.microsoft.com/en-us/library/dd547590(v=vs.110).aspx
Converting from WS to WAP - https://msdn.microsoft.com/en-us/library/aa983476(v=vs.100).aspx
Right click on your project and go to Properties and then Web. On servers section change the IIS.

Trouble setting up IIS for ASP

Windows 7 Ultimate
IIS7
At first I enabled all settings in IIS, the default page of IIS could be viewed but when I tried to view pages in C:\inetpub\wwwroot\MyWeb, I used to get a 404 error.
Then I tried:
ASP
ISAPI extensions
Request filtering
It didn't show me the default IIS page even. Then I tried:
ASP
ASP.NET
ISAPI Extensions
Default document
Static content
Request filtering
It showed me the default page but when I tried to view files in the directory, Chrome said that the link appears to be broken. At present my settings are:
IIS management console
.net extensibility
asp
asp.net
cgi
isapi extensions
isapi filters
server-side includes
default document
static content
request filtering
Still, I am getting the "link broken" message.
Oh, and I am using Dreamweaver CS5 and when I preview the ASP page from Dreamweaver it asks me if I would like to specify a testing server. I choose No as I am new to this and not aware of how to specify a server. Is that the problem?
This is the official site for your problem:
http://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8
The first entry is probably what you need.
I recently set up ASP on IIS8 by simply installing the server features you listed first (ASP and ISAPI Extensions). Maybe you have another problem, like a wrongly setup website in IIS. You could enter a simple default.asp or maybe you should try a iisreset and check that some static file is available where you expect the asp files to work.

asp .net 4.0 app on IIS7 Error 404.17

I am having a problem setting up a website under IIS 7. I have created an application and the application pool for the application. Application pool is using .Net Framework 4.0 as my .net app is written in .Net Framework 4.0. Application pool is set to use classic Pipeline Mode. MIME Types have been automatically added to .asp & .aspx.
When I run the website windows explorer is showing me "View Downloads" and trying to download "application name localhost" when it downloads the file I notice that its the html of my default.aspx. I have checked Default Document and it contains Default.aspx.
If I remove .asp & .aspx MIME Types then I get an error: HTTP Error 404.17 - Not Found The requested content appears to be script and will not be served by the static file handler.
I have seen this problem many times. IIS is not serving aspx pages and most likely is not running for the entire server or that site.
For the entire server: Check to see if iis world wide web service is running.
For the site alone: Hit run inside IIS.
You can easily know if IIS is running properly by going to IIS and hit the browse option from inside a web site.
With the data you have put these are the things I would try in order if I were you:
Check in Server Manager/ Features if ASP.NET is installed (ServerManager/Roles/Web Server(IIS) look for ASP.NET
Check IIS Manager if everything is ok by:
Try to browse a test.html file to see if you are able to browse normal
Check Basic settings by clicking Test Settings
Check Handler Mappings to see if aspx is there.
Try to browse a sample test.aspx page with test data.
Check Application pool settings.
Reinstall Framework 4.0
Reboot machine ( a classical)
If you gave us more info and/or the ouput of my proposed tests maybe can help more. Good Luck :)
I had the 404.17 error happening on a server today. As you and cad mentioned, I checked the framework of the Application Pool that my site was using to make sure it was set to ASP.Net 4.0, and it was. What happened in my case is that my site was not using the application pool that I thought it was. My site was nested under another site, meaning my site pointed to a subfolder but another site was pointing to the root folder. Even though I had my site set to use the ASP.Net 4.0 Application Pool, the root site used a different Pool that had ASP.Net turned off, it was set to "No managed code". When I set the framework to 4.0 for the Pool the parent site was using, then my site started working.
In my case the solution was fixing the Handler mappings as explained here: http://forums.iis.net/post/1943489.aspx
IIS Manager->high-light you web site->click Handler Mappings icon on
the home pane->click Revert to Parent...
on the right Actions pane

Startup Page on host server doesn't work in asp.net web application

In visual studio MyProject properties I set the Login.aspx page as startup page and it works fine when I use the local host, however when I publish to the external host server the startup page is ignored and the aspx page in the URL is displayed. What am i doing wrong? host server has IIS6, 3.5 FrameWork
Startup Action, and specific page in this case is only used for Debugging purposes, not for the initial page to load on your web host.
If your web host is using IIS7, you can use the <defaultDocument> web.config element.
Otherwise, you can set the value in IIS (see here), or possibly find a workaround elsewhere.
The startup page is only for the ASP.NET Development server that is created by Visual Studio..used for testing & debugging your code.
Since you're publishing to IIS 6.5, you can set your default documents(s) on the website's Documents tab in IIS. Add your default starting page to the list there & move it to the top.
On II6 if you right click the web site --> Properties then go to Documents, there is a Enable Default Document. That list is where the default document is set.

Unable to access asp.net website after setting asp.net version to 2.0 in IIS 6.0

I have an asp.net website that has been running well in IIS 6.0. I very well remember the sites ASP.NET version was set to version 2.0 in IIS but i just checked and found the version set to nothing. If i click the site asp.net version dropdownlist in IIS, i can see two options(1.1.4322 and 2.0.50727).
The problem is i set it back to 2.0 and now the site can nolonger be accessed both remotely and locally.
And i cant set it back to "nothing" since the version dropdownlist only has two options( 2.0.50727 and 1.1.4322).
Any ideas what could be going wrong.
Below is what i get in the browser
The page cannot be found The page you
are looking for might have been
removed, had its name changed, or is
temporarily unavailable.
Please try the following:
•Make surethat the Web site address displayed in
the address bar of your browser is
spelled and formatted correctly.
• If
you reached this page by clicking a
link, contact the Web site
administrator to alert them that the
link is incorrectly formatted.
•Click the Back button to try another
link. HTTP Error 404 - File or
directory not found. Internet
Information Services (IIS)
Technical Information (for support
personnel) •
Go to Microsoft Product
Support Services and perform a title
search for the words HTTP and 404.
• Open IIS Help, which is accessible
in IIS Manager (inetmgr), and search
for topics titled Web Site Setup,
Common Administrative Tasks, and About
Custom Error Messages.
This is the culprit
http://blogs.msdn.com/b/webtopics/archive/2010/06/14/iis-6-applications-may-stop-responding-after-you-install-microsoft-update-kb-982666.aspx
​​​​​​​​​​
It sounds like .NET isn't properly installed on your IIS website.
Try to open a command prompt, step into %windir%\Microsoft.NET\Framework\v2.0.50727\ and run aspnet_regiis.exe (use the directive -? for help). If you only run one IIS website on your server you can run aspnet_regiis.exe -i
Hope this may help you.
.net 1.1 and .net 2.0 don't get along well on IIS 6.0. You must run one of the frameworks in a different app pool - so, for every 1.1 website, for example, run it in a new app pool (other than the default).

Resources