I have a asp.net web application that I am trying to deploy to IIS on Windows Server 2016. I first ran the application on Visual Studio 2017 and it loads and runs perfectly fine but on IIS when I run it on localhost it loads up but with the code headers on it and no functionality.
There are no errors thrown from the browser perspective or event logs so I don't know how to troubleshoot specifically. Most of the research I have done on this issue points to not having HTTP activation feature enabled but I have installed everything and still this issue has not been resolved. Most of the suggestions and answers I have tried were for the old IIS 7.5 or 8 not IIS 10.0 which I am using. The application runs fine on visual studio so I'm guessing that it is not a problem with the code but with my IIS configuration. I'm hoping someone can help me or at least point me in the right direction. This is my first question ever so I'm not sure what else is needed (i.e code, specifics) for me to get a proper answer. I will provide what is needed. Thank you
Thanks for your comments guys. After searching for solutions using the framing of the question as "IIS not serving ASPX files" I found a solution which worked which was to go IIS -> select your website -> go to handler mapping and then press revert to parent option. Apparently my handler mapping for the website were incorrect or not configured properly but everything works now. Thanks for your help.
Related
I seem to be having noob level errors here Publishing an ASP.NET app locally.
The site is:
Published to an ApplicationPool with No Managed Code per suggestions here
Is literally just the template code app from Microsoft specified in this article - no extra stuff.
I'm just trying to test settings here on my local machine before seeing how it works on another machine but perhaps I'm missing something? Everything I've read I can on the subject and simply can't seem to get this going - any step-by-step walkthroughs about doing this?
In my case, the answer was staring me right in the face - I was missing the AspNETCore Module. I thought I had it when enabling everything else with IIS but apparently, I didn't.
I was compelled by work to upgrade from Visual Studio 2010 to Visual Studio 2013. In VS 2010, I used the built-in host for viewing .net apps locally and everything worked just fine. Visual Studio 2013 dropped support for the built-in host and compels everyone to use IIS Express.
My trouble is that IIS Express won't serve up "[anything].aspx" no matter where in the folder tree of the project it resides. I created two test files in the root of the project: HelloWorld.html and HelloWorld.aspx (c#) and made both to simply show a page saying "Hi" with the asp.net file showing the current date and time. I then copied these two test files into an arbitrary folder in the project. After building the project (unnecessary, I know), I did a "View in Browser" for all test files. In all cases, the HTML files displayed properly. The aspx files cause a "HTTP 400 Bad Request" / "The webpage cannot be found" error.
I've prowled Stack Overflow and Google and read about some near-misses but ultimately came up empty for this specific problem. I'm hoping this is a simple configuration issue, but the answer so far eludes me. Thanks in advance for your kind assistance!
Edit:
Thanks to Lex Li's suggestion of using the Jexus Manager to see what's going on with the IIS Express configuration, it shows that zero apps are assigned to any of the default application pools. Correspondingly, when clicking on the home of the website in the Jexus Manager, the .Net section of the website is absent.
Edit #2:
The web app is assigned to one of the default IIS Express app pools: Clr4ClassicAppPool.
Sound weird, did you try open the iis express xml applicationhost.config and check there the mime type or the application pool settings?
I am using visual studio 2010 on .net4.0 for my projects and I've found that each time I do a change in my project, I build and run but I cannot see my changes. I've found this happening once or twice mostly with my web service projects. I'm no pro with web services and am encountering this problem for the first time so would be grateful to anybody who can tell me what has gone wrong with my project and how to fix it.
Edit
My asmx file is where I have added an additional method but am not able to see it when I run F5
When you change the compiled code in a web service or site, you need to make sure you restart the web server hosting that service or site.
You are probably using the ASP.Net Development Server. Although Visual Studio starts this server for you, it does not restart it automatically when you rebuild. As a result, the server will still be referencing the previous version of the assembly that you changed.
In the Windows system tray you should see one or more icons depicting a web page with a purple gear overlapping it at the bottom-left.
There are three of them in this example:
You can stop the server by right-clicking its icon and selecting "Stop". (If you have more than one, you will learn to identify the one you need to stop by recognizing the port number shown in the tooltip when you hover the mouse over the icon.) Visual Studio will restart it when needed.
When you're making changes to a service or site, use this workflow:
Make code changes
Stop the ASP.Net Development Server
Rebuild the project containing the changes
Run
Client-side code vs. Server-side code
If you're changing client-side code (HTML or JavaScript), then you may need to force your web browser to refresh its cache. In Windows this is normally done by pressing CTRL+F5 in the browser (see refreshyourcache.com/en/cache for more info). If you're changing compiled code (C#), and restarting the server doesn't help, try restarting Visual Studio, then do Build -> Clean Solution, then Rebuild.
If you are facing issues in ASP.Net Development Server, I think you are better off creating a virtual directory in IIS and host your web service there. That way you should be able to make your changes, just build it (don't run it) and that should be available on your virtual directory and you just browse to webservice. Then you don't have to hit F5 again and again and don't have to worry about instances of ASP.NET dev server.
Following article contains good step-by-step instructions on how you do it on IIS 7.0. This article is about hosting a website - however, hosting a webservice is not different.
http://www.codeproject.com/Articles/28693/Deploying-ASP-NET-Websites-on-IIS-7-0
I'm running IIS7, .NET 4.5 and have a site that is MVC2.
I'm getting the error "This operation requires IIS integrated pipeline mode." when I navigate to a page (an aspx View) with a form on it with an AntiForgeryToken on it.
<%=Html.AntiForgeryToken() %>
I've searched around and seen the AddHeaders solution that fixes this error for other people (who are running IIS6) but I can't see how that would be similar.
The reason I mention the AntiForgeryToken, is because if I take that line out, the page works!
EDIT:
I've tried reinstalling .NET 4.5 - didn't help
EDIT: My AppPool is definitely set to "Integrated" Managed Pipeline Mode (ApplicationPoolIdentity). It's the only app in this app pool.
Run the application in IIS Express. This solved the same issue to me. Just right click your project and choose "properties" and click "Web" tab, there under servers click "use localIIS web server and click "USE IIS express"
Upgrading to MVC3 using the upgrade tool has fixed the problem
http://blogs.msdn.com/b/marcinon/archive/2011/01/13/mvc-3-project-upgrade-tool.aspx?Redirected=true
I realise this isn't always a viable fix for everyone - so will leave this question open, hopefully someone else has an idea on fixing the MVC2 solution.
I'm trying to run a freshly created ASP.NET Website using C#, however when I do so it launches FireFox and attempts to connect to http://localhost:1295/WebSite1/Default.aspx (for example), but after about 10-15 seconds it displays a "Connection Interrupted - The connection to the server was reset while the page was loading." Error.
This issue is also present with older ASP.NET C# pages/Web Services I've built in the past, nothing is actually running off the ASP.NET Development server.
I am using: Windows XP Pro SP2, Visual Studio 2008
For reference I have SQL Server 2005 Developer Edition installed as well.
I have tried:
Browsing it with IE instead of Mozilla
Trying 2.0 framework instead of 3.5
Reinstalling Visual Studio 2008
This problem seems so trivial the more I think about it, but I havn't been able to work it out just yet! Appreciate any help on the matter.
I had the same problem, and when I was about to quit and run away and join a monastry I had an idea to check ELMAH - maybe it had caught it...
Sure enough, ELMAH told me it had caught this:
System.Web.HttpException (0x80004005): Maximum request length exceeded.
and this fixed it:
<system.web>
<httpRuntime maxRequestLength="65535" />
</system.web>
Good luck,
Dave
When you launch the application, a little info mark appears at the right bottom of your screen telling you that the local web server was started and on wich port. You should compare that port to the one that appears in your browser. If they are different, an anti-virus could be responsible for that problem.
Another place to look is your host file. Some software tweak this file and can make your localhost disbehave.
Something like Fiddler or another proxy like server could cause this issue if local addresses are proxied.
You can check this under Control Panel/Internet Options - Connections Tab, Click LAN Settings down the bottom.
Try adding "127.0.0.1 localhost" before the line reading "::1 localhost"
in c:\windows\system32\drivers\etc\hosts
This worked for me (VS2008, Vista Ultimate)
I had a similar problem on Windows 7 RC and Visual Studio 2008 SP1. Changing localhost to 127.0.0.1 helped. Similar to the hosts file solution, but doesn't require the file editing, you just need to change the project startup url.
I've the same problem, just instaled VS 2008 in a Vista Business machine. I have a LAN, but no proxy server and the c:\windows\system32\drivers\etc\hosts" with "127.0.0.1 localhost" are there. but none of my projects work, neither new ones.
"I had a similar problem on Windows 7 RC and Visual Studio 2008 SP1. Changing localhost to 127.0.0.1 helped. Similar to the hosts file solution, but doesn't require the file editing, you just need to change the project startup url."
This solution is working fine.......