I have an Asp.Net 4.0 Web Forms project that uses url routing for user friendly urls, i.e hiding aspx-pages behind clear text urls.
In this project we have an asmx web service that serves some jQuery controls on the pages. Everything has worked fine so far on development machines and the internal testing site but now when we installed the project on a production site the asmx calls are trapped by the routing code.
We have a catch all route that is added last that shows the Not found -page.
When I open the web service on the server (http://localhost/service.asmx?op=MyWebMethod), enter some values and click Invoke I get the Not found page. The url that Invoke opens is http://localhost/service.asmx/MyWebMethod so it's all quite logical (service.asmx looks like a directory) but I don't understand how this can work on all other installations of the same project.
The production server is Windows 2008 Server R2 Standard, the project is Asp.net 4.0 and I haven't registered any StopRoutingHandler for asmx-files.
The web.config files are identical between the internal testing site and the production site and the machine.config -files haven't been touched to my knowledge.
routes.Add(new Route("{resource}.asmx/{*pathInfo}", new StopRoutingHandler()));
Related
I have an asp.net web site which runs on port 443 which is https. I also have a asp.net web api which also needs to run on port 443. Because of that, I decided to create a new web application under asp.net web site. I also created a new application pool for that. The problem is that when I try to run web api project, I keep getting configuration file errors. For example it says Default Connection is already added since asp.net web site web.config adds Default Connection already before web api project does. Are there any special steps to take in order to make this work?
I'm evaluating Telerik's Sitefinity CMS. On my dev box (Win7 x64/IIS7), everything works great.
However, when I deploy the site to our Win2k3/IIS6 server, the backend system doesn't work correctly. According to fiddler, anytime the browser makes an AJAX request to a WCF (.svc) service within the application, the home page is being returned.
Any suggestions?
I've tried:
re-registering ASP.net
Re-registering WCF with
\windows\microsoft.net\framework\v3.*\wcf\servicemodelreg -i
Made sure that the .svc extension is allowed
Deleted and recreated the site in IIS
Argh. Suggestions?
You can find installation information and other tips on getting Sitefinity up and running by visiting the documentation.
This turned out to be related to the IIS6 application pool identity, permissions on the web folder, and having multiple authentication methods checked in site properties. By playing with those things I was able to get it to work.
As a test, I ran the site through the Sitefinity project manager app (using its integrated Cassini server), and everything worked correctly.
We configured IIS 5 by mappping * to asp.net handler so that ASP.NET MVC works. After configuring this, directory browsing is not working.
Also uploadify jquery plugin is not working. Showing IO error 2038.
Can someone please suggest us how to enable directory browsig with ASP.NET MVC configurations on IIS 5?
I don't think that you'll be able to get directory browsing to work with ASP.NET MVC in the same application. When you added the wildcard mapping, you told ASP to handle every request. If the request doesn't map to an actual file, it will try to match a route in MVC. If there isn't a matching controller with an index (assuming that's your default) action, then it will fail.
My suggestion is to split your web site into "application" and "content". Set up the application as a separate web site and apply the wildcard mapping there. Leave your content with the original configuration. I don't use IIS5 any more -- with one exception on an old XP development box -- I'm afraid that can't really be of more help.
If I were you, though, I'd upgrade to a more recent OS and web server. Expecting new technology to work on a decade-old platform is very optimistic.
Today we tried to put an ASP.NET application I helped to develop on yet another production machine. But this time we got a very weird error.
First of all, from all the ASP.NET pages, only Login.aspx was working. The rest just show a blank screen when they should have redirected to Login.aspx. The HTTP response is 200, but no content.
Even worse - when I try to enter the address of some inexistent ASPX page, I also get HTTP 200! Or, when I enter gibberish in some existing ASPX page code (which should have been accessible without login) I also get HTTP 200.
If I enter the name of some inexistent resource (like asdasd.jpg), I get the expected 404.
The redirect to login page is written manually in Global.asax. That's because the application has to use some alternate methods of authentication as well, so I can't just use Forms Authentication. I would suspect that Global.asax is failing, if not for the working Login page.
Noteworthy facts are also that this machine is both a Domain Controller and has SharePoint installed on it. Although the website in question is listed in SharePoint's exception list.
I would check the following:
Is the application within a virtual application or its own site and not just a virtual directory?
Does the application have it's own App Pool? If it does not then is the app pool shared by apps in a different .net version.
Is the .net version of the application the correct one? 1.1 or 2.0?
Do the files in the file system have the correct permissions to be accessed via IIS?
Have you performed an IIS Reset?
Create a stand alone test.aspx page within your folder that just displays the date/time and check it works.
Make this single test.aspx page perform an exception (eg. divide by zero) and see what the outcome is.
More information required.
What Op Sys?
What mode IIS running under?
What version of .Net?
What version of SharePoint?
(Why are you using your DC as a web host?)
Does it work on the other production machines you've deployed to?
If so what is different between this machine and the working ones?
Did you deploy the same way?
Are you sure your hitting the right machine?
Are you sure your hitting the right web site?
What ISAPI components are installed globally and for the web site?
Is .aspx mapped to the ASP.Net ISAPI filter?
Do you have any HTTP Modules or HTTP Handlers configured?
Can you change the global aspx to write out some messages so you can be sure the piece of code you interested in is reaching?
Anything coming up on the IIS log or the event logs?
Addition:
What version of .Net?
By the sounds of it the .jpg request is being dealt with by IIS directly which is why you get the 404, but the .aspx request is being dealt with by something else which except for you login page, is always returning 200.
Assuming .aspx is wired correctly to .Net the the order of processing is based on ISAPI filters (high to low then global before site), then the ASP.Net ISAPI Extension (sorry I said this was a filter earlier but it's actually an extension). Then we get into the ASP.Net pipeline based on your .Net configs, and calls the HTTP Application (which includes your global.asax code), any HTTP Modules followed finally by a HTTP Handler. Your ASP.Net web forms are just fancy HTTP Handlers.
However, the request can be responded to and terminated from any point.
Since your code works on other machines though, I'm tempted to point a finger at SharePoint if it isn't installed on the working machines. Is this SharePoint 2007? That is also an ASP.Net application (I don't think 2003 was).
I have a web application that runs fine under IIS5 or IIS6. I just installed Vista, which has IIS7. I just copied the entire web app over as-is, no changes to any files. I went into the IIS7 manager and created a web appliction under the Default Web Site and pointed it to the app I copied over.
When I try to browse to the app in IE, it tells me there's nothing there to handle it and that directory browsing is not turned on. This is a .NET app, so it uses Default.aspx. I looked in the manager, and there was no handling of Default.aspx setup. Is that not on by default for IIS7?
So, I added Default.aspx, and now the error is "HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map."
I thought maybe it was because the default for IIS7 is Integrated Mode, so I created a new AppPool for Classic Mode and changed my app to use that. I still get the same error.
I was under the impression that I could move .NET apps to IIS7 without any changes. Is this not true?
0) Check if you have asp.net extensions installed under Programs and Features - Windows Features - WWW services - Application Development Features - .Net Extensibility / ASP.Net
1) The Microsoft .net framework
2) Try copying the whole directory to your IIS's root folder (usually wwwroot), common error that iuser/iwam does not have rights to read the other folder.
3) Check under "Handler Settings" if you have .aspx associated with any Isapimodules.