MVC3 site / bin deployed / 404 error on image file - asp.net-mvc

I have an MVC3 website that I am trying to deploy on an existing server with IIS6. The server has .NET 4 installed, but does not have MVC3 installed. I've put all of the referenced dll's in my bin folder on the server.
When I set the wildcard map the server throws 404 errors for every document on my site - even static documents (e.g. /public/images/nav.png). If I get rid of the wildcard map, then I can browse to static images (like nav.png).
Any ideas why 404 errors are occurring for static files that exist when the wildcard map set?

Try to deploy you solution with MVC3 required DLLs: How to Deploy an ASP.NET MVC 3 App to Web Hosting with "\bin Deployment"

right click on project node , build deployment package ,this works for me .
for more [link] http://www.hanselman.com/blog/BINDeployingASPNETMVC3WithRazorToAWindowsServerWithoutMVCInstalled.aspx

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

Deploying asp.net mvc app to folder

I have a hosting running windows, lets say the root domain is xxx.com. On xxx.com there should be website running on php (since IIS can run PHP, right?) or asp.net. I really dont know yet.
I am now responsible of making a asp.net mvc app, which should be running only inside a folder like xxx.com/myaspapp.
I've tried to publish the app straight to the folder via visual studio and it fails with an error:
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This error
can be caused by a virtual directory not being configured as an application in IIS.
What is a solution for this? Is this scenario even possible?
Thank you.
WebDeploy can create a virtual application under an IIS site automatically. Check it out:
THE ANATOMY OF A WEBDEPLOY PACKAGE
It is simple to host an application in a sub folder. Follow the below steps.
Create a folder (myaspapp) under the root site path.
Open IIS Manager (inetmgr) and expand till the new folder.
Right the newly created folder and click on Convert to Application.
Deploy/Upload the application files directly to this folder.
Now you will be able to access the site from the sub folder.

IIS and MVC show folder structure

i have tried to deploy an mvc application in an windows server 2008 with iis7.
i have copied all the content to the inetpub/wwwroot folder
i changed the framework version of the application pool to v4.0
i ran the aspnet_regiis.exe
the project was properly released because i have deploy succesfully to my desktop dev (iis) and one arvixe hosting, but i cant make it work on the server.
but i can only see the folder structure, i tried creating virtual directorys and everything, but nothing works. am i missing something.
thx

MVC4 WebSite 404 Error on IIS7

Set-up
I have a website built in Visual Studio 2012 using MVC 4 and .NET framework 4.5.
It is being hosted on a Windows 2008 and running IIS7.
I am using a VS2012 "Web Deploy Package" to deploy to the server. I manually copy this to the server and run the install using the web deploy cmd script option /T and then /Y. It all installs fine to the Test folder.
On the Test website in IIS the application pool is pointing to the DefaultAppPool which is set for integrated and pointing to the .Net Framework v4.0.30319
I have created a new Web Site in IIS for the application called Test and defaulted the bindings for port 80 and stopped the default web site that is in IIS.
I've created a new foldeer called Test under wwwroot which is where the Web Deploy script is set to point to, when I created the script I add "Test" as the Site/Application
When I have created the web deploy package on my local machine I am manually copying the zip file and other deploy files (cmd,*.xml) to the remote server
I have run %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i on the server and installed .net 4.5 framework and MVC framework components I could see in the Web Platform installer.
Problem
This website was previously being hosted on Windows Azure and have been able to direct publish to Azure and everything runs fine and when I go to any page it displays as expected.But on the new web server I get a 404 when I go to any page.
Everything seems to be installed as far as I can see on the web server. I was able to stop my website and re-start the default web site and add an index.htm file and that displays fine.
It almost seems like something in the MVC pipeline is not initialising. I'm using the standard Home controller with Index action that comes as part of the VS20102 MVC template as a test and that returns me a 404 when I go to /Home.
I've also tried other endpoints (I have WEB api rest endpoints off /API/* and these are returning 404 errors).
I'm just wondering if there is some basic set-up I've missed. It almost seems like some service is not running correctly and picking up the MVC website.

Deploying ASP.NET Application on IIS7

I am developing an ASP.NET MVC 4.5 application in C#. It works flawlessly when I run it after compiling on my local IIS Express.
However, when I try to upload it to a remote server it does not seem to recognize anything in its root directory. It only displays the default welcome screen.
I have tried reconfiguring the web.config file to point to Global.asax file, without any success. I am able to load single images by modifying the URL according to the sites structure.
What is the initial "starting file" on ASP.NET MVC 4.5 and how do I configure IIS7 to load it?
Check you server configuration (if possible), first enable Web Server (IIS) role (is posible to add from Server Manager or PowerShell), then install .NET Framework, or use aspnet_regiis.exe from .net framework folder (C:\Windows\Microsoft.NET\Framework\v4.0.30319 and C:\Windows\Microsoft.NET\Framework64\v4.0.30319) if server has configured iis web role and .net framework installed but configured incorrectly. If unsure what role features to add use Web PI and add IIS Recommended Configuration (http://www.microsoft.com/web/downloads/platform.aspx)
Note: In Visual Studio 2012 project template for MVC 4 Web Application references as copy-local MVC Assemblies from NuGet and therefor you don't need to install MVC 4 on web server.
Command to register current .NET version (from folder wich you are executing this utility, execute for both, first for 32-bit and than for 64-bit on 64-bit OS) with IIS:
aspnet_regiis -i
PowerShell to add Web Server role:
PS> Import-Module ServerManager
PS> Add-WindowsFeature Web-Server
If you see the default IIS welcome screen then it's probably because of incorrect website bindings (IP:port:hostheader). Whenever IIS cannot locate a website with specific binding it falls request back to "Default Web Site" with *:80 binding which you probably observe.

Resources