MVC4 Deployment in IIS 7.5 Windows 7 - asp.net-mvc

I have Developed a MVC4 Application and Deployed in IIS 7.5 in Windows 7.
Before Deploying i ran aspnet_regiis - i and published using VS 2012.
After Deploying in IIS 7.5 i was able to open the Home page successfully and tat is not the end of the story as i thought !
Now i have few ajax call to fetch Data were am not getting any results. And i tried in Firebug to see what happens and am getting "Error Summary HTTP Error 404.0 - Not Found" and Error code: 0x80070002.
Then i compared the Header section from Locahost and IIS and i dont see much Difference.
I added <modules runAllManagedModulesForAllRequests="true" /> in my web.config.
PS: EveryThing looks fine if i run Locally but not in IIS.and have installed IIS in my Local Machine.
Do i need to add anything or any suggestion on how to Fix will be much Appreciated.
Thanks

Related

Angular 4 spa template deployment on iis

I created a angular 4 application using VS 2017 angular spa template and it works fine in my local machine. I'm having issues setting up the project on the server IIS.
I have published the files on the server, I created a site on the IIS and mapped it to the index.cshtml under the \views\home\ directory. When I browse the site I'm getting http Error 404.3 - Not found.
Target framework is net461 and iis version is 8.5
Could you please help to resolve this issue.
I had to install aspnetcoremodule for IIS to resolve this issue.
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/aspnet-core-module?tabs=aspnetcore2x

After upgrading to MVC 5, my site returns a 404 error when published to production server

I recently upgraded my application from MVC 4/ EF 5 to MVC 5 / EF 6. I also upgraded to Visual Studio 2013 from VS 2012. Everything runs great on the IIS Express but when I publish to my production server via webDeploy, the site returns a 404 for all pages.
I am running IIS 8. There are no entries in my IIS log from today so this is not logging. I see no event alerts either.
I have done some research and performed the following:
Set the System.Web.MVC, System.Web.Routing and
System.Web.Abstractions to use a local copy when publishing. This
had no effect.
I restarted IIS.
I deleted all the files on the production server and re-published.
Thanks so much for your help!
Turns out that the problem had to do with Amazon eleastic ip - nothing wrong with the site or IIS.

VS2012 Web project runs in VS Dev Server, but not in IIS

I have an MVC v3 project I've inherited. (I'm not that familiar with web stuff.) The project runs fine in Debug mode using the Visual Studio Development Server.
However, whenever I try to run it via IIS locally, it fails with 401.0 Unauthorized. "You do not have permission to view this directory or page".
I have read pages and pages and tried many options to no avail, such as:
configured the following users to have full control of my code project folder (Everyone, IUSR, NETWORK SERVICE, ASP.NET, me, IIS_IUSRS, DefaultAppPool)
checked that I have <modules runAllManagedModulesForAllRequests="true"> in web.config
configured an Application Pool using .NET v4 / Integrated.
configured a new Site in IIS Manager using port 81 and my custom Application Pool
tried Pass-through authentication or nominating myself as a specific user.
The error occurs in IE, Chrome and FF.
Detailed Error Message
HTTP Error 401.0 - Unauthorized
You do not have permission to view this directory or page.
Module ManagedPipelineHandler
Notification ExecuteRequestHandler
Handler System.Web.Mvc.MvcHandler
Error Code 0x00000000
Requested URL http://localhost:81/
Physical Path F:\Serko\Code\Analytics\SERKO.Analytics.Web
Logon Method Anonymous
Logon User Anonymous
Environment
Windows 7 Ultimate, VS2012, IIS7.5
I do not have much hair left to pull out. Any idea why this does not run in IIS?

Can't make WebAPI application work on windows 2008 server

I'm new to Web API Applications. I created my very first application with only one simple Controller with only one Get() method that returns a List.
In my PC it works fine. Even after I publish the solution and access it via my IIS 7.5, the results are ok: I access
http://localhost/Application/api/Controller
and I get the answer I expect.
So I moved forward to the next step: deploying it to another server so other people in my office can access it. The server we use runs a Windows 2008 server. What I did was to simply copy the Publish folder generated by the publish command in Visual Studio 2012, and paste it in the inetpub\wwwroot folder in the server computer. Then, I accessed the IIS 7.5 that's running on the server and created a new application using the .NET 4.0 Application Pool, using the Publish folder as its physical path (exact same steps I did in my PC to publish it to my IIS).
The problem: when I try to access the application in the server machine (that's running windows 2008 server), I get the 404 error. It seems like it tries to find a physical path Application\api\Controller, insted of resolving it logically like my machine does.
I did try all the different solutions I found in the web:
I did enable all verbs in the ExtensionlessUrl-Integrated-4.0 under the mappings configuration for the Application in the IIS.
I did add the WebApiConfig.Register(GlobalConfiguration.Configuration); in my global asax.
What I noticed is that my machine has the .NET Framework 4.5 installed and the server machine only has the 4.0 framework (client and extended). But I get the same error even after compiling the application targetting the 4.0 framework.
The only MVC .dll I have in my bin directory is the System.Web.Mvc.dll... do I need any other DLL?
Thanks in advance.
Try this:
<system.webServer>
.....
<modules runAllManagedModulesForAllRequests="true" />
.....
</system.webServer>

How to Deploy an ASP.NET MVC Application onto Windows Server 2008 IIS 7.5?

I have built an MVC 3 application and I have a Web Server 2008 on which IIS 7.5 is installed.
In IIS, I created a new Site and under which an Application then I deployed all my physical files on that application folder:
C:\inetpub\wwwroot\DeveloperToolsPortal\Application
I have also configured my Application Pool so that it supports .NET 4. I also downloaded the MVC3 on this server from the asp.net/mvc3 website.
When I browse this application from IIS using the {0} url, I get the {1} error message:
{0}: http://localhost:85/Application/Home/Index
{1}: HTTP 500 Internal Server Error
The Site was configured to use port 85 as 80 was already taken by another Site.
I've also added the below configurations in the web.config file:
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
</system.webServer>
<customErrors mode="Off"/>
Why is this getting this error? How could I fix it? Which step/s have I missed in configuring my application?
I also tried another thing. I added a simple .htm file under my application and tried openning it via IIS and it gave me the below error:
Internet Explorer cannot display the webpage
I'd guess there is something wrong with my IIS?!
Don't put it in a subdirectory of C:\inetpub\wwwroot
The problem is that by default, there's a web.config file in C:\inetpub\wwwroot, which IIS will read from, even though your site is not directly in that directory.
You can create another folder in C:\inetpub and put your site into there.
Also, you can have multiple sites running with the same port, but using different host headers.
Out of curiosity, where did port 85 come from? Try taking that out (the default port for HTTP is 80). Also, look in the application error log for additional info on the error. There is also a section of web.config that you can set so that detailed error messages will be displayed (which should not be set for production).
<customErrors mode="Off">
</customErrors>
I added some more features/services to my IIS using the Server Manager and registered asp.net with it using aspnet_regiis -ir and this error is resolved.

Resources