Routing problem with particular controller name using ASP.NET MVC 1 in IIS 7 - asp.net-mvc

I have joined a team developing an ASP.NET MVC version 1 application. I run this app on my local machine using IIS version 7.5. My operating system is Windows Server 2008 R2 Enterprise Edition. I use Visual Studio 2008 SP1 for development.
One of the controllers in this app is called ReportsController. The route table entries for this controller use 'Reports' as the controller name part. The problem I have is that, using IIS 7.5 on my local machine, I simply cannot access any of the Reports action methods. If I try to access, say, '/Reports/Index' from Chrome or Firefox, I get a 401 Unauthorized response (as seen using Fiddler) and the browser displays its username/password entry dialog.
Please note the following:
All other non-Report pages in the application work correctly.
If I add a breakpoint to Application_BeginRequest, it is not hit when requesting a Reports page.
If I change the Reports routing entries in the route table registration code so that I have to access paths like '/Reportss/Index' (note the extra 's') then these Reports pages work correctly.
I have tried deleting then recreating my Web application in IIS.
The Reports pages work fine if I run the application using the Visual Studio 2008 development server (Cassini).
There is no directory called Reports in the application directory.
The Reports pages work correctly on our UAT environment, also under IIS 7.5.
I have reviewed my IIS setting several times, including comparing them with those on UAT, and I can't see a problem.
While I can use Cassini to access the Reports pages, I would really like to understand what is causing this issue.

If you have Reporting Services installed on your machine. try to create a new web site and use it. If you have SSRS installed on your machine it uses /reports for hosting reports.

I have had problems using the directory name 'Reports' at the root of a .net 2.0 website on IIS 7.5. It generates a 503 Error, indicating that there is an error at the system level before IIS tries to serve the page. I am not sure if reporting services is installed on my server. I just changed the directory name, all links and everything worked.

I have the exact same issue in my MVC Application with reporting services installed on the same server where code was deployed. I have changed the Reporting Manager URL in "SQL Server Reporting Services Configuration" which was hostName/Reports and assigned a new name i.e. SSRSReports so the virtual directory is now hostName/SSRSReports.
Now my application as well as SSRS Reports are working as expected.

Related

How do you publish an ASP.net MVC application from Visual Studio 2013 to your local network?

I made a simple ASP.net MVC web application in Visual Studio 2013, and I want to deploy it so it can be accessed from the browser on other computers on my local network. I have tried right-clicking my project > Publish (not sure what settings to use, Web Deploy, Web deploy package, File system,
I published the website to my inetpub/wwwroot folder.
I managed to get IIS up an running, I've tried adding an application in the manager and editing the permissions to Everyone. I tried navigating to localhost/application_name but I was getting errors about not being configured to list the directory. I enabled directory browsing, but that just means it now shows a list of the files. How do I get it to actually run the app when I navigate to it in the browser?
Am I close?
Edit: currently trying this http://johan.driessen.se/posts/Accessing-an-IIS-Express-site-from-a-remote-computer (although this I think is a step or two ahead of where I am)
Also tried this: http://www.programmerfish.com/how-to-deploy-asp-net-web-application-on-the-network-in-windows-7/#.VGTLCvnF81L no luck so far
You can use IIS Express which comes with visual studio 2013. I've used this method to allow other members of the staff to access the website that is in my computer. Scott Hanselman has done a great post which I use every time when I want to expose a website hosted in local iis express to others in the same network.
http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx
If you have any queries, let me know. Hope this helps
When I want to use IIS Express within Visual Studio for development, but allow local network users to see a version of my site, I tend to create a publish profile in VS that publishes to the local file system (e.g. C:\Publish\<yourwebsite>). Then from IIS Manager create a new website pointed to that same folder and it should be accessible to you via http://localhost and to network users via http://<your-pc-name> or http://<your-local-ip>.
You will need to add an exception to Windows Firewall to permit HTTP requests (i.e. port 80) through to your local machine, but if you have configured IIS correctly they should see the website.
It is possible to make IIS Express available to remote clients but that's not what it's designed for so really you're better off going down the IIS route since this will allow you to test the configuration as it would be on a live/production setting at the same time.
Check this, and old version of the same question. I'd bet you need to install IIS locally
Use Visual Studio web server in local network
You need to enable IIS on the host as IIS Express is not built with that in mind. Its for debugging purposes.
You've also not mentioned your binding configurations or your app pool settings.
Here is a comprehensive tutorial on how to publish your application using IIS IIS Video tutorial
You will need to ensure the binding that you specify is available across the network and that the connecting clients have permissions.
The issue was that ASP.net was not registered with IIS
Opened command prompt as administrator
Navigated to C:\Windows\Microsoft.NET\Framework64\v4.0.30319
Ran aspnet_regiis -iru
Now web app runs in IIS http://www.asp.net/web-forms/overview/deployment/configuring-server-environments-for-web-deployment/configuring-a-web-server-for-web-deploy-publishing-%28remote-agent%29

Deploying ASP.NET Web API App to IIS 7 On Different Server

I have been literally stuck for hours trying to deploy a Web API app to IIS. I can not believe there are no useful tutorials online anywhere that I can find. Here is my situation.
I have a VERY basic Web API app. It is using .NET Framework 4.0. It doesn't do anything I just want to see the home page at this point.
I am developing it in Visual Studio 2012 on my local machine. I can hit my localhost and see the home page, even post some data through Fiddler works great.
I publish the solution using Build->Publish to my local file system.
I then copy and paste everything in that directory to my web server (actually using a repository but for simplicity sake)
I created a brand new application pool in IIS. .NET 4.0 Integrated.
I placed the folder that contains my published code inside of the directory of my main website. The folder name is WebAPI.
I created a new website in IIS, attached to that new app pool I created.
I start the website, browse it on localhost and everything works perfectly.
I try to go to the website externally "website.com/WebAPI/api" and get a
403.14 - Forbidden The Web server is configured to not list the contents of this directory.
I'm sure I'm doing something wrong, I've never deployed an MVC app to IIS on another server. I'm able to deploy it just fine on my local machine through IIS too. What am I missing? Thanks!
Edit: Yes, my server has other .NET 4.0 apps running just fine.
http://localhost/api
http://website.com/WebAPI/api
Is this correct?
If so, looks like it could be a path problem.

Unable to run Silverlight application from Visual Studio 2010

I'm in the process of setting up a new machine as a development environment and I'm having issues getting an existing code base that hosts a Silverlight application to work. The code runs fine on all other machines that my team uses.
Here is the error:
Error: Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: Could not download the Silverlight application. Check web server settings
I have had a Google around for some answers on this and I realize there is a duplicate question on StackOverflow already, but it does not provide enough information and the answers have not worked for me.
I am attempting to run the solution through Visual Studio 2010 Ultimate, using IIS Express 7.5 integration (as opposed to the Cassini web server). This approach works perfectly fine on all other machines, except for this one.
I have found that if I specify to use full IIS integration (instead of Express) and select the SilverlightTestPage.aspx as the start up page, then the application runs (although not perfectly). Also, if I publish the application and host it on IIS, it again works fine. However, when running through Cassini or IIS Express 7.5 integration, or when trying to get it to run through the Default.aspx or correct start up page it does not work.
Does anyone have any ideas what this might be? I've already checked that the MIME type in IIS is correct (not sure if I can do this in IIS Express as well?) and that the XAP files are building into the correct directory.
Check MIME types in IIS Express configuration file %userprofile%\documents\iisexpress\config\applicationhost.config and make sure that you have MIME types set correctly and restart IIS Express.
Please check the aspx file whether it has the "minRuntimeVersion" correctly for the Silverlight plug in.
<param name="minRuntimeVersion" value="4.0.50826.0"/>
also check the following link for hosting the Silverlight application .
Configuring IIS for silverlight

ASP.NET deployment issues (Not working in release mode)

I have an asp.net mvc 2 application which works fine when run from visual studio either in release or debug mode. When the application is deployed to either a remote or local IIS 7 server in release mode it doesn't work.
The error displayed is as follows:
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Now this is a bit misleading however I have worked out why this error message is being displayed.
The application does not have a default.aspx as this is not needed when running mvc apps on IIS7+
I am using attribute routing which is explained in the link below which uses reflection to build the RouteTable. When interrogating the assembly the attributes are not accessible therefore the RouteTable does not get populated
Since there are no routes the web server attempts to list the directory contents and it does not have permission to do that.
Attribute Routing:
http://itcloud.codeplex.com/
ASP.NET MVC Routing Via Method Attributes
Now my question is what is preventing the application from being able to interrogate the assembly using reflection?
DaTribe
Lack of ReflectionPermission is a likely cause. Many hosting companies over-restrict permissions. Reflection is one that is often problematic. GoDaddy and RackSpace both restrict it.
What trust level is your application running? What hosting provider are you using? Do you have RDP access?

ASP.NET MVC project won't start under IIS 5.1 on Windows XP SP3

I've a ASP.NET MVC 2 project that runs fine under Windows 7 and will start on Windows XP if I use the Visual Studio Development Server, however, starting under IIS generates an error:
Unable to start debugging on the web server
With the message
The specified procedure could not be found
No errors in the system event viewer.
If I start without debugging I get an "HTTP 500 Internal Server Error"
The reason I run it under IIS is the project also includes some WCF wsHttp web services that use certificates, so the VS Development Server is not adequate for hosting those.
I have already seen the links on SO that talk about adding the wildcard mapping. I've already done that, just as I've done on Windows Server 2003 where I successfully host ASP.NET MVC RC2 for quite a while.
See if this helps - its possible but not ideal:
http://blogs.microsoft.co.il/blogs/dorony/archive/2007/12/15/using-asp-net-mvc-on-iis-5.aspx
Check out this blog it might help. IIS 6 and under does not easily support MVC Routing.
http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx
The error said "procedure could not be found" so I double checked the ISAPI dll.
Turns out when I added the wildcard mapping to ISAPI, I picked aspnet_filter.dll instead of aspnet_isapi.dll. Once I switched it, the app starts up fine and serves pages fine.

Resources