Why a 404 on every available page on a Web Site project? - asp.net

I've just opened a Web Site project found on my predecessor's machine and - I hate the things and don't ever work with them - I get a 404 on every link I click, while the page is definitely present. If I directly view the individual page in the browser, that page works fine, except for any links on it to other pages.
It's like the built-in dev web server isn't operating and interpreting URL requests, but I have no idea where to look to clear this up.
USING IIS: If I create and deploy this site under IIS, everything seems to work normally.
MY MAIN QUESTION IS: Why do pages get not get served on this site and do get served on similar sites, under debugging a Web Site project on VS2012. It is not how to solve the problem by deploying to IIS.

Related

ASP.NET Website issue - will not load externally

I have a site that works fine on the server itself. I can browse to the site from within IIS or by launching a browser on the server itself. However, if I try to access this externally, I get a 404 error.
I have tested DNS for the domain in question (www.phanetworktest.com) and that is not the issue. I was able to create another site with a single, simple HTML page and the site was then accessible outside of the server. I believe it is either a configuration issue with IIS or maybe a problem with the application itself. It is an ASP.NET 4.6 application.
The error when I try to navigate to the site externally is "404 - not found".
There is a variety of other sites also running on this server, including a classic ASP site, an ASP.NET 4.6 website, and two ASP.NET MVC sites.
Any help would be greatly appreciated.

Published website ASP.NET with IIS

I have just completed my website and I started working with IIS it works fine when I put all my file without published. I copy the whole website to wwwroot inside my folder as I said It works fine but when I tried to work without code behind page it didn't work I published website from VS. and I copy my published file to the same folder but it doesn't work.
I received this error:
Eval is not declared. It may be inaccessible due to its protection level.
I don't want to put my code behind page. How can I run my published pages?
First, when you publish your web project, their are no code behind pages.
Do this, set a directory and publish your site in it.
Now cmd-> intemgr->
site-> -> add web site->
give site name and select an application pool, then set the physical path to the directory where your application is published, if necessary change the port to something like 50 because 80 is a standard port for http. Hit ok. Your site is ready.
Please check in application pool that your application pool is set to .Net framework version V4.0 (i mean the version compatible to your app ).
just click to browser the site, please do check the uri you can see the port number also

IIS Windows Authentication does not work with Webmatrix / Razor CSHTML

I need to use IIS Windows Authentication instead of Anonymous so that I can get the visitors username. The server and all the pages are on a local domain and all visitors are logged into the domain. The problem I am having is that Windows Authentication does not work with Webmatrix pages.
On IIS we just have one site and there are various pages and sections. Some are ASPX and now we also started creating CSHTML with Webmatrix/Razor. When enabling Windows Authentication and disabling Anonymous, any page that you try to load (ASPX, CSHTML, etc...) automatically redirects to /Account/Login?ReturnUrl= which does not exist and results in a 404 error.
I don't know why this happens.
Windows Authentication worked fine before the Webmatrix files were added.
I have tried numerous suggestions and nothing has resolved the issue.
I found several posts online saying that there maybe a bug in Webmatrix and that the WebMatrix.Data.dll and WebMatrix.WebData.dll are causing the issue. So just as a test I deleted these files from the Bin folder and right away the ASPX files started to load fine and authentication worked OK. Problem is that without these DLL's none of the CSHTML pages work which is what we really need.
Is there a fix for this? Removing the DLL's I mentioned is not an option for us since it breaks the most import functions which is querying and displaying data from SQL but at the same time I really need Windows Authentication to work with Webmatrix and CSHTML because we need to know who is using the pages and its impossible when IIS is running in Anonymous mode.

ScriptResource.axd 404 error ONLY on subdomains

I have setup my website (ASP.NET 4.0) with AJAX, running with no problems at all.
When I test my website locally and on my main top level domain, there are no problems.
When I'm on a subdomain page, AJAX client side framework fails to load. I observed the problem deeply and found that whenever I'm on a subdomain page, WebResource.axd DOES load but ScriptResource.axd DOESN'T load (returns 404 Not Found error). I think I should modify some entries at web.config file, but I have no idea on what to do?
If you want to see the problem live, go to www.123tiendas.com/subdominios/articulo/default.aspx?id=2020 and there's no problem. Go to www.articulo.123tiendas.com/?id=2020 and you'll see the problem. (use any web developer tools to see what is returned)
GET http://articulo.123tiendas.com/ScriptResource.axd?d=BHVdt7ZKRNgWkcmIzZPX-cQ…NHSxpLPXcqbJyg46pdNsVlEnaL_JpR-IQ0IdhPXwT575CanbqzCN8vtDLDFF9A2&t=48e38e19 404 (Not Found) articulo.123tiendas.com:119

Precompiled .NET app receiving "Internet Explorer cannot display the webpage"

We have a web server that is running many web applications. When I took over this server, I noticed that the sites were not precompiled, so in an effort to clean it up, I precompiled the site using the Publish option in VS2008 (and allow the precompiled site to be updatable).
When I deployed the site to the web server, the site stopped working - In IE, I get "Internet Explorer cannot display the webpage" - in firefox I get "Unable to connect. Firefox can't establish a connection to the server at >>sub.domain.com<<". Here are a few things I've noticed:
I am able to manually browse to the one static .html file that is part of the site
If I replace the precompiled files on the server with uncompiled code, the site works fine
If I switch the application pool to use .NET 4.0, I get errors with duplicate system.web.extensions module, which I would expect to see with an application built for .NET 3.5.
When I initially browse to the site after a fresh IISRESET, the app redirects to /Login.aspx, which the web.config defines as the forms auth login page. It then redirects to /default.aspx and displays the error in question.
CustomErrors is OFF, debugging is ENABLED, and yet I don't get a helpful .NET error page, and I see no System or Application-level events in the Windows event log.
Any hints as to why this might be happening? I was able to successfully precompile another site on the same server with ZERO problems.
I found the problem myself. The login page was redirecting to HTTPS if the host header wasn't localhost. I noticed that in the uncompiled site, someone manually went into the .VB file for the login page and added the specific domain for the beta site into this check, preventing the redirect to HTTPS. I copied the code into my local, recompiled, and deployed, and now the site works as expected.

Resources