URL Routing and IIS6. How can I test it? - c#

I can't seem to understand how I can find out what is erroring out when I implement URL Routing on IIS6 and Webforms.
I continue to get 404 errors when I try to access a route.
I add the ISAPI module as described here:
http://blog.codeville.net/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/
SO that way ASP.Net handles all the requests, but THEN I get a 404 error just accessing the site.
Is there a way to tell if the URL Routing engine is even getting the request?
UPDATE:
For the 64-bit version of Windows (which I failed to mention) the correct DLL is:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
If you're not sure which version (or you want to be sure you get the right path) just copy the value that is in the Executable Path of the “aspx” extension in the ListBox above the WildCard Mapping box.

Here are the exact steps we took to fix this problem, although you may have already done this based on your post. On our development boxes, it worked fine, but not on the Windows 2003 server with IIS6.
In IIS, right click on the Virtual Directory, select Properties.
Under the Directory tab, click the Configuration... button.
Under the Mappings tab, under the Wildcard application maps (order of implementation): click the Insert... button.
Browse and select C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll for 32-bit or C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727 for 64-bit, leave Verify that the file exists unchecked.
Move Up aspnet_isapi.dll to the top of the list.
Click Ok, Ok, and try it. Try recycling the application pool if you don't see it work.
Can you confirm this is a server, not your dev box? Can you confirm that the server has .Net 3.5 SP1?

Related

Deploy WebAPI to external website

We have a public website that is already exposed to the outside, although in reality there's really nothing there. Simply default.htm file with "Coming Soon" text in it. (http://vensuresoftware.com/)
We also have a WebAPI we've put together that we want to add to this website. When I publish locally to my IIS6, it works no problem. It's accessed as http://localhost/HRConnect/api/Claims just fine. I've used PostMan, a C# client, and Javascript AJAX to access this just fine. I can also load it in a browser at that URL, and I get the appropriate default controller and action.
However, I have been totally unable to accomplish this same thing on the website. Ideally I'd like to include it as a Virtual Directory to the http://vensuresoftware.com and access it as http://vensuresoftware.com/HRConnect/api/Claims but I've had zero luck doing so.
I have tried to add it as a Virtual Directory as well as an Application under that specific website, but when I access the URL, all I get is "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."
I've ensure the Application pool is correct, with an appropriate user and the pass through connection test succeeds. But I just cannot access the service or the URL.
Any ideas or suggestions at all on what I can try? I'm not sure what else I can include here. Nothing special in IIS, nothing special in the service really. There's only 3 actions in it. As I said, it all works beautifully locally, under localhost though.
IIS 7 doesn't have built-in support for extensionless URLs which causes a lot of headaches trying to get MVC and Web API apps to run. I've gotten it to work using both these options. Pick the one that applies to you.
Install this IIS patch which allows IIS 7 to handle extensionless URLs.
If the patch isn't an option because you're worried about breaking other sites on the server, you can make the Web.config adjustment found in this answer. You'll have to do this for every MVC/Web API app you have running on the server.

Publishing .NET 4.5 ASP.NET website on IIS 7.0 yields an error 404 though the files exist

I am trying to deploy my first ASP.NET application on a server running IIS 7. But I always get an error 404 when trying to open the page. I thought it might be a start page issue, so I entered a direct URL to a .aspx file inside the wwwroot folder, but that got me another 404. Next step was to set a start page in the IIS Manager to a certain .aspx file, which made the page open, but the URL shown didn't include the specific page, and I didn't see my bootstrap navbar (just links that should be inside it) nor my Infragistics components. (To give context, we just upgraded the server to .NET 4.5 this morning, but all other ASP.NET websites in the same or other application pools still work perfectly!).
I then enabled the option to see folder contents in the browser; opening the website then showed me all the files that were supposedly not found, but clicking on them gave me 404 again. For testing purposes I put a .html inside the main folder: that one I could click and open, as well as *.css files or images in subfolders. But as I said above: ASP.NET is installed and working for all the other websites. I checked the MIME things, there is nothing for ASP related files, but neither is there in the working projects. The handler mappings seem to be correct as well.
So what could the reason for this be? I am totally unacquainted with IIS, so I lack any ideas beyond simple googling :/ My guess would be something permission-related (the app pool it's currently in is using pipeline mode: classic; but again, the same as the working stuff) or another dynamic content option I missed. Or - since as soon as I manually define a start page to be one of the .aspx files, I see at least something - it could be related to extensionless URL's? When I manually enter
myservername\myappname\StartPage.aspx
the browser at least shows
myservername\myappname\StartPage
instead. But I can't seem to find an option to change this. Any help is greatly appreciated!
I ran into this issue when I first started working with ASP.NET. I spent hours scratching my head trying to figure out what was the problem. After a fair bit of research this is what solved my problem. I added the flowing code in the web.config file.
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"></modules>
</system.webServer>

Changes to Website Files Not Showing Up in IIS 7

I have migrated 2 DLLs and an aspx page to an existing web application on a production server. The changes in the file do not show up when I run the web application.
I have restarted the web application, restarted the associated application pool, run iisreset, deleted the Temporary ASP.NET Files. The changes do not show.
I have created a new html file in the root of the application, but it returns a 404 File Not Found error.
In IIS, I right-click the web application and choose Explore just to make sure that I am in the correct directory. I am. I see my updated files there. I can view the text of the aspx page, and my changes are there. My test html file is there.
I have searched StackOverflow, implementing all of the prior solutions I have seen that have fixed other poster's questions. Is there anything else I can do to IIS, the file system, or anything else to get these changes to show?
It sounds like you are not hitting the website that you think you are. Check your bindings and host headers, maybe another site on the server is intercepting the request.

Can't make my application available on a website (through IE)

I've written a simple console application in VS what users should retrieve from a website. In IE I'm able to download by right-click -> 'Save target as...', but a simple click on the link drops me the below error.
I've "googled" around and it seems there is no reliable way to force the download and skip the choice of direct running.
Is it possible that my app has some signature or security issues? How can I avoid this error?
*edit: It's just a standalone program, not an installer.
*edit2: Not a duplicate, it has to work on a static html page.
After removing ClickOnce manifest signature I don't get the error, and I can download it without any issues.

WSAT (ASP.NET WebSite Administration Tool) is not working

When I click WSAT (ASP.NET WebSite Administration Tool) icon, it doesn't open automatically, but I have to click on the dev server icon on system tray and open it up and it brings me WSAT with only a message:
An error was encountered. Please return to the previous page and try again.
Maybe this has to do with the URL it opens:
http://localhost:52785/asp.netwebadminfiles
I remember to see a longer URL sometime, like a URL having a query-string with "filepath" or "filedir" or something like this.
Can someone help me with this or indicate a tutorial to create my own user management on an MVC application?
Since I had the same problem, here is what solved it for me:
first you need to run the project, and then run the website admin tool. That way it should work without problem, at least for me it did.

Categories

Resources