Windows Server 2003 IIS Renders ASP.NET 4.0 pages as blank - asp.net

I have a web project which works fine on my local development machine.
I copied the project to our UAT server, setup a virtual directory pointing to the project and configured it to run on .NET Framework 4.0. I even added the Default.aspx page to the Documents tab. I configured Directory Security to use Windows Authentication.
When i try to access any web page within this application, IIS responds with a blank page. I looked through the event logs and don't see any errors anywhere.
Can someone please help me understand what's going on and how to remedy this?
Thanks in advance!

If you're just seeing a white page with no errors in the event log, it sounds like it could be a problem with the application rather than the hosting environment.
However, there are a few things you could try to doing to troubleshoot this.
Check folder permissions. Try allowing "Everyone" access on your webroot folder and see if that makes any difference.
Confirm that the IIS path is set up correctly but putting a text file in your webroot folder, and then browsing to it and verifying that it's contents are displayed.
Create a basic test.aspx page without any script, just a "Hello World" bit of text, and try browsing to it. Confirm that it displays the correct content.
Edit web.config and turn off custom errors
Try re-registering the ASP.NET extensions with IIS using aspnet_iis (details here)
Hopefully, one of these tests will be able to give you some kind of detailed error message or more insight into the cause of the problem.

For IIS 6.0 on Windows Server 2003, after the install of .NET Framework 4.0, the process of creating Web Sites or Virtual Directories that run under .NET Framework 4.0 is as follows:
Create a new application pool.
Applications running under different
frameworks can't be hosted in the
same application pool, i.e. create
an application pool perf framework.
Next, if you are creating a local
intranet site or virtual directory,
ensure that you don't have "dots" in
the application name. Browsers
confuse the dots to be external web
sites, forcing them to run under
internet zone as appose to the
intranet zone.
Once you create your web site or
virtual directory, make sure that it
runs under an application pool
dedicated for .NET 4.0 applications.
Ensure that when creating your
website or virtual directory, you
click on the ASP.NET tab and select
version 4.0 from the drop down.
Then you may configure as per
normal, with any other additional
settings you may require.
Hope this helps someone experiencing similar issues. Took a while to figure out.

Related

IIS7 MVC Routing Not Working

Our company ships an MVC based product (targeting v4.5) which has stopped working on a customer site for what appear to be environmental issues - a build which worked with no problems once upon a time now gives a 403.14 - The Web server is configured to not list the contents of this directory.
.
What I think is happening...
The user accesses http://server/AppName
Because it's an MVC app, the default route (Reports/Index) should be used.
Instead IIS is looking for a default document...
... and, not finding one, it assumes the user wants to list the contents of the directory...
...which is not enabled so it throws a 403.14.
.
What I've tried so far...
Accessing the route directly.. results in 404 error. So I'm pretty
sure IIS doesn't realise it should use routing.
Use aspnet_regiis to register ASP.Net with IIS. This was done from the Framework64 folder since...
OS is 64 bit - Windows Server 2008 (Standard without Hyper-V)
IIS is 64 bit - though Enable 32-Bit Applications is true
Checked AppPool is targeting v4 of the framework - it is.
Changed AppPool mode to Classic - was pretty sure it should be integrated but was worth ruling it out. It is now back to Integrated
Confirmed RunAllManagedModulesForAllRequests is set to true in the web.config.
Checked permission conditions defined in <system.webServer> section of web.config are met - they are.
Created the simplest of MVC applications and deployed it - same problem.
Running the command shell as Administrator unregistered ASP.Net using aspnet_regiis -ua and re-registered using aspnet_regiis -enable -i. We hit a couple of permission problems - and the Temporary ASP.NET Files directory was missing but once they were address we were back to the same error.
Added a simple default.htm - when present, this is served in response to the http://server/AppName request.
I'm clean out of ideas and all google hits suggest some combination of the above - or enabling directory browsing (which I think is just a symptom rather than the root cause).
Also, not sure if it's relevant but the amount of configurable elements available for the application in IIS seems a bit below what I would have expected...
Have you Checked the user the application pool process is running under? I think Your site needs to run with permissions to execute the .net libraries and I've seen this just change for seemingly no reason (probably related to an overzealous update to the system).
You can try with the Enabling directory browsing .
assuming you are under Windows Server 2012 or Windows Server 2012 R2
On the taskbar, click Server Manager.
In Server Manager, click the Manage menu, and then click Add Roles
and Features.
In the Add Roles and Features wizard, click Next. Select the
installation type and click Next. Select the destination server and
click Next.
On the Server Roles page, expand Web Server (IIS), expand Web
Server, expand Common HTTP Features, and then select Directory
Browsing. Click Next.
On the Select features page, click Next. On the Confirm installation
selections page, click Install. On the Results page, click Close.
if you using the Windows PC try this in your command prompt as follows:
go to C:\Program Files\IIS Express
then press Enter:appcmd set config
/section:system.webServer/directoryBrowse /enabled
Maybe this is your case https://forums.iis.net/t/1157304.aspx
SQL Server Reporting Services creates a folder called Reports by
default if you install it on IIS. If you install SQL 2008 then
Reporting Services doesn't need to use IIS and instead will try to
reserve the URL with the HTTP.Sys service.
I believe this is the cause of the conflict you are seeing. What you
could try is changing the URL that Reporting Services uses via the SQL
Server Configuration Wizard.
Also I found that
Report Manager of SQL Server can use reports path http://<server name>/reports
Configure a Native Mode Report Server for Local Administration (SSRS)
I think the problem is IIS features that are not installed yet. I have met this kind of problem frequently in Windows Pro. Make sure to turn on every feature under Internet Information Service -> World Wide Services because by default IIS is configured to use WebForms. So there might be some features that not installed yet to use MVC, especially ISAPI filters. In my case, that was the solution. I hope it helps.
Something similar i encountered using VS 2017 & ASP.NET MVC.
Was working on the project for long with no problems at all but suddenly the routing started misbehaving & stopped working.
So I changed the Port in Project Properties Page & it started working.
I really don't know what is the relation between a port & MVC routing modules. Someone else can enlighten if at all this helps.
I had the same problem and I just created an application pool out of the Default Web Site in IIS and stoped the default web site. With that difference you will not have the application pool's path
I know it's been a long time since this question but i've had the same problema recently. I've tried every single configuration, just like #amcdermott did, but the only action that solve the problem was reinstalling .NET Framework.
My app was built under .NET Framework 4.5.2. The application server had the version 4.6.1 and 4.5.2 installed. So, i uninstalled all framework versions and installed the one that i needed.
Please, make sure that no other applications use superior versions of .NET Framework if you going to try this solution.
Here are some quote I find on Microsoft official site which I think may help:
For site administrators
This problem occurs because the Web site does not have the Directory Browsing feature enabled, and the default document is not configured. To resolve this problem, use one of the following methods:
Method 1: Enable the Directory Browsing feature in IIS (Recommended)
To resolve this problem, follow these steps:
Start IIS Manager. To do this, click Start, click Run, type inetmgr.exe, and then click OK.
In IIS Manager, expand server name, expand Web sites, and then click the website that you want to modify.
In the Features view, double-click Directory Browsing.
In the Actions pane, click Enable.
Method 2: Add a default document
To resolve this problem, follow these steps:
Start IIS Manager. To do this, click Start, click Run, type inetmgr.exe, and then click OK.
In IIS Manager, expand server name, expand Web sites, and then click the website that you want to modify.
In the Features view, double-click Default Document.
In the Actions pane, click Enable.
In the File Name box, type the name of the default document, and then click OK.
Method 3: Enable the Directory Browsing feature in IIS Express
Note This method is for the web developers who experience the issue when they use IIS Express.
To do this, follow these steps:
Open a command prompt, and then go to the IIS Express folder on your computer. For example, go to the following folder in a command prompt:
C:\Program Files\IIS Express
Type the following command, and then press Enter:
appcmd set config /section:directoryBrowse /enabled:true

Deploy website from a Windows XP Desktop

On my Windows XP desktop, I have a fairly simple ASP.NET targetting .net 4 in Visual Studio 2010. I can run it on my local host by ctrl + F5, it works all fine.
I have a Windows Server 2003, that I can access via mstsc, but also via Explorer. When I go to the publish section of my build properties, i see 4 publish methods :
Web Deploy, FTP, File System, FPSE
I have already installed IIS 6 successfully on the Windows Server, and given all authorizations for everything I could so far (to get things to work in the first place, will check on that later).
How should I proceed to publish to that remote machine ? Should I target a specific folder ? Do I need to setup things in IIS 6 for that site first ? Or will it all get settled from te properties I have in Visual Studio ?
Thank you guys,
J.
Personally I've always plumped for a manual deployment; that is I create the Web Site in IIS creating an appropriate AppPool and targeting the correct .NET version to utilise. From there simply copy (xcopy if you will) the appropriate files over, e.g. DLL and all supporting pages such as ASPX, CSS and associated images. In most situations where I have direct / RDP access this is what I run with.
That said, this can be automated from Visual Studio and this can be useful for those situations where you're maintaining an awful lot of sites on a regular basis. With IIS 6 and Visual Studio, this was achieved by installing FrontPage Extensions on the server then utilising the Publish option.
For VS2010 it seems this has been streamlined using the IIS Web Deploy module and configuring the Studio to publish in this manner that looks mildly quick...
HTH
I've never used the Web Deploy feature in 2010, so I can't really tell you about its merits or drawbacks. I've read that it works much better with IIS7 than IIS6. If you have direct access to the IIS root folder on the server (typically c:\inetpub\wwwroot) through a network share I would recommend doing the file system deployment. FPSE works as well if you have to publish to the server through a remote URL, but there are some security issues with FPSE that make enabling it on your web server a less than ideal choice.
Once the files have been deployed, all that should be left is to configure the website as an application inside of IIS.
Remote in to the web server and open IIS
Right-click Default Web Site and choose properties (if you've deployed to a subfolder in the root, then locate that folder and choose those properties instead
Switch to the Home Directory tab (Just 'Directory' for a subfolder)
Look for the Application Settings section and click the button that says Create
Optional: Select an app pool if you have created a custom one from the default
That should enable IIS to execute your .aspx files inside of your application. Once you've successfully configured the app for the first time, you can just keep publishing your app to the same location over and over without having to reconfigure it.

My ASP.NET application is not working on the server, but it works in my development environment.

My ASP.NET application is not working on the server, but it works in my development environment.
How do I go about debugging this?
First, when posting such a question to stackoverflow, post as many details as possible. These people on this site are brilliant and can fix your problem in a snap if you provide them enough information.
Confirm that you have deployed ALL dll, aspx, ascx, .vb, .cs, exe, image, and config files.
Confirm that you have deployed ALL folders
Confirm that your web.config has a valid connection string
Confirm that your entire folder tree has read/write permissions for network service account. (this can be backed down later)
Confirm that your entire folder tree has read permissions on the IUsr account
Confirm that your application pool (IIS Manager) has the same .NET Framework as your application was compiled in. It's probably .NET Framework 4.0, but might be 3.5 or 2.0
Confirm that the web server has port 80 and 443 open in its firewall
Confirm that asp.net is installed on the web server
Navigation to C:\Windows\Microsoft.NET\Framework\v4.0.30319 in the command line and run aspnet_regiis.exe -i if you need to reinstall asp.net 4.0. Sometimes this fixes problems.
Confirm that the web server serves up an html file. Add a file called test.htm to the root folder, and only include "Hello, I am test.htm" as its contents. Attempt to visit this in a browser. If it does not load, check permissions again.
Confirm that you have a dll on the server for every custom reference that you have added to your project, and confirm that the dlls are at an accessible path to the deployed web application (like, sitting in the bin folder)
I have the same problem as the person that post the question. I my development machine it runs smoothly. Deploying it in my own development machine opens the website bu gives me different w3wp.exe codes when opening a specific page inside my website.
I t seems it is a memory problem. I have tried different approaches but nothing seems to work.
The page that I am trying to open in has different linq queries.
I answer as much as I could from your questions.
Confirm that you have deployed ALL dll, aspx, ascx, .vb, .cs, exe, image, and config files.
Yes
Confirm that you have deployed ALL folders
Yes
Confirm that your web.config has a valid connection string
Yes
Confirm that your entire folder tree has read/write permissions for network service account. (this can be backed down later)
Confirm that your entire folder tree has read permissions on the IUsr account
Confirm that your application pool (IIS Manager) has the same .NET Framework as your application was compiled in. It's probably .NET Framework 4.0, but might be 3.5 or 2.0
Yes 4.0
Confirm that the web server has port 80 and 443 open in its firewall
Confirm that asp.net is installed on the web server
• Navigation to C:\Windows\Microsoft.NET\Framework\v4.0.30319 in the command line and run aspnet_regiis.exe -i if you need to reinstall asp.net 4.0. Sometimes this fixes problems.
Confirm that the web server serves up an html file. Add a file called test.htm to the root folder, and only include "Hello, I am test.htm" as its contents. Attempt to visit this in a browser. If it does not load, check permissions again.
Confirm that you have a dll on the server for every custom reference that you have added to your project, and confirm that the dlls are at an accessible path to the deployed web application (like, sitting in the bin folder)

Execute a dll function in ASP.Net Bin not working, II7

I am developing a remote control application where a client (aspx page in a browser) can request a server to "launch a notepad" (for testing purpose, for real life, turning off a light bulb, etc). So I created a dll with a simple function for launching the notepad (on the server side) and dropped this dll in the root bin folder.
It worked fine when the aspx page is running under ASP.NET development server (launched from Visual Studio). But when I tested the same aspx page under a FireFox browser, it did not work (launch the notepad) even though it did call for the same function (I stepped through in debugger).
Is this a permission issue? How do I set this up in IIS manager, or even better in web.config?
Please help.
Yes, it sounds like a permission issue.
The application pool in IIS 7 that your site is running under is probably using the default identity, which is the most restrictive. You can change the identity in IIS Manager by right-clicking on the app pool (probably called DefaultAppPool) and selecting Advanced Settings. From there change the Identity value to Local Service or Network Service. If neither of those work, making it Local System should allow your page to work.
I assume the Visual Studio integrated web server runs under the context of the account you are logged in with on the machine, which likely has a lot more rights.
When you say:
it did not work (launch the notepad)
Did you mean it through an exception or you didn't see a notepad window open. If it was a permissions issue I would expect you that you would get an exception. Chris is right on when he says:
The application pool in IIS 7 that
your site is running under is probably
using the default identity, which is
the most restrictive.
and
I assume the Visual Studio integrated
web server runs under the context of
the account you are logged in with on
the machine, which likely has a lot
more rights.
and if this is a permissions issue he is right on. However, the user your running under (when not debugging in Visual Studio) most likely cannot access the desktop of the logged in user. Maybe you should try your test with an app that doesn't need to interact with the desktop.

Cruisecontrol.NET & IIS7 Static File Handler Problem

I'm trying to get Cruisecontrol.NET running with Server 2008/IIS7 and when I try and navigate to the dashboard I get the following 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'm a bit lost in IIS7 so it could be something pretty straightforward. They (cc.net) do some funny stuff with http handlers in the web.config which may be related to the problem:
Anyone have any pointers?
Is the dashboard set up as an application in IIS?
I've not used IIS7, but I know in IIS6 you need to enable an application and assign it to an app pool before you can run ASPX code.
EDIT: This works in IIS6.
Open the IISAdmin tool on the web server. Expand the web sites folder. Find the virtual directory (directories?) for CruiseControl. Right-click on it and look at properties. On the directory tab, create a new application and give it a suitable name. Enable the application to execute "scripts only". Assign it to an application pool (you may want to create a new one just for this application -- consult the help documentation for this). You may also need to change the ASP.NET version You can do this on the ASP.NET tab -- choose either v1.1 or v2.0, whichever CruiseControl requires.
In Vista, go to Windows features in the control panel. there is a section there for IIS and you will find the scripting setting under the IIS 6 compatibility section
I just had this same issue when I installed CCNET 1.5 under Windows 7/IIS 7.5
You need to configure the app pool for the ccnet site. Under the Basic Settings for the application pool, set 'Managed pipeline mode' to 'Integrated'.

Resources