i want to transfer my ASP.NET MVC project to another server - asp.net-mvc

I want to transfer my ASP.NET MVC project to another server(obvious with different IP address). I transfer the published code there and also map with the same link through IIS (and stop that site from previous server). And also change the connection string with updated database details.
I get this error:
Not Found
HTTP Error 404. The requested resource is not found.
Kindly help.

First of all, you need to figure out whether the request is sending the request to the right server. So please ensure the domain is pointing to the correct IP. Please ensure accessing the website via IP and domain name are getting same response.
If you are sure the request is reaching the right server, then you should see the 404 error in Server IIS log. Please enable failed request tracing and IIS detailed error to find the sub-status code and exception code.
If you see the 404 is returned from static file handler. Then please ensure IIS asp.net extension has been installed so that extensionless handler would help handle the MVC route URL.
If you have already installed asp.net extension. Please post more details and we may find the root cause.

Related

Server Error in '/' Application. in mvc

In MVC application Host the IIS Server. It's showing folders I clicked views folder show the below error.
Server Error in '/' Application. The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its
dependencies) could have been removed, had its name changed, or is
temporarily unavailable. Please review the following URL and make sure
that it is spelled correctly.
Requested URL: /PMS/Views/
Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.0.30319.17929
I'm not sure if it's relevant to yourself but I only get this error when I try to start the application on a page which requires a value to start.
For example you have a garage page that requires a garageId to set values/ show details. Because there is no value being passed to the page, that page cannot be found.

Asp .net MVC is working when I run it locally but I get internal network error when I deploy to azure web apps?

I am having an internal server error immediately when I deploy my code to Azure web apps even though it runs perfectly fine on my own machine. My code is from a tutorial and close to this example:
https://github.com/elishnevsky/OdeToFood/tree/master/src/OdeToFood
However I do not have a web.config or an OdeToFood.xproj since they are not included in the tutorial. I tried including the ones that are in this git project but the error doesn't change. I ensured the permissions were configured to allow everyone to have full control.
My project is connected to a remote database that I can successfully connect to and manipulate from my local machine.
I have gone into the azure diagnostic tools and turned all the logging options on, however the error message being shown in the log stream doesn't change.
The error can be seen below.
I have tried including a random image to counter the favicon.ico error but that did not change anything.
Can anyone advise on some debugging tips, I think I need an idea on how to get a verbose error message.
IIS Detailed Error - 500.0 - Internal Server Error
HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.
Most likely causes:
IIS received the request; however, an internal error occurred during
the processing of the request.
The root cause of this error depends on which module handles the
request and what was happening in the worker process when this error
occurred.
IIS was not able to access the web.config file for the Web site or
application. This can occur if the NTFS permissions are set
incorrectly.
IIS was not able to process configuration for the Web site or
application. The authenticated user does not have permission to use
this DLL.
The request is mapped to a managed handler but the .NET Extensibility
Feature is not installed.
Things you can try:
Ensure that the NTFS permissions for the web.config file are correct
and allow access to the Web server's machine account.
Check the event logs to see if any additional information was logged.
Verify the permissions for the DLL.
Install the .NET Extensibility feature if the request is mapped to a
managed handler.
Create a tracing rule to track failed requests for this HTTP status
code. For more information about creating a tracing rule for failed
requests, click here.
Detailed Error Information: Module AspNetCoreModule Notification ExecuteRequestHandler Handler aspNetCore Error Code 0x00000000 Requested URL http://OdeToFood20170518102616:80/ Physical Path D:\home\site\wwwroot Logon Method Anonymous Logon User Anonymous
More Information: This error means that there was a problem while processing the request. The request was received by the Web server, but during processing a fatal error occurred, causing the 500 error.
Microsoft Knowledge Base Articles:
IIS Detailed Error - 500.0 - Internal Server Error
HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.
Most likely causes:
IIS received the request; however, an internal error occurred during the processing of the request.
The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
IIS was not able to process configuration for the Web site or application.
The authenticated user does not have permission to use this DLL.
The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.
Things you can try:
Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.
Check the event logs to see if any additional information was logged.
Verify the permissions for the DLL.
Install the .NET Extensibility feature if the request is mapped to a managed handler.
Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click.
Detailed Error Information: Module AspNetCoreModule Notification ExecuteRequestHandler Handler aspNetCore Error Code 0x00000000 Requested URL OdeToFood20170518102616:80/favicon.ico Physical Path D:\home\site\wwwroot\favicon.ico Logon Method Anonymous Logon User Anonymous
More Information: This error means that there was a problem while processing the request. The request was received by the Web server, but during processing a fatal error occurred, causing the 500 error.
Microsoft Knowledge Base Articles:
According to your github project, I have crate a test demo on my computer. I found this project has define a custom Physical File Provider (You could find
the it in the Middleware folder: UseNodeModules).
By cloning the project to the local, VS will automatic download the js file into the node_modules folder.
When publishing the project to azure web app service, the VS will not copy the node_modules folder to the azure web app. So the application will how 500 error.
I suggest you could find the UseNodeModules folder in the local and copy it to the azure web application.
More details, you could refer to below steps.
1.Open the KUDU console in your web app.
2.CLick CMD console and local the wwwrot folder
3.Add new folder and upload the node_modules folder.
Restart the application, them your project will work well.
Since your project isn't as same as the github projects, if you still get the mistake.
I suggest you could change the application setting as below to see the details error message.
1.Open application setting in your web service portal.
2.Add Hosting:Environment as below:
Besides, I suggest you could check your web application's connection string. Azure web app couldn't connect to the local server if you don't use Hybrid connections.
I suggest you could create a azure sql server and change the connection string as azure sql server's connection string.

I am not able to run Asp.Net MVC 2 Application

I am trying an sample application in Asp.Net MVC 2 Application
given in http://www.codeproject.com/KB/aspnet/aspnet_mvc_tutorial.aspx
But i am getting the error as below
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Views/PersonalInformation/Index.aspx
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
Please let mw know wat is the problem
The problem is the requested url. In an ASP.NET MVC application, the url corresponds to a controller action instead of the aspx page. See this link for an explanation: http://www.asp.net/LEARN/mvc/tutorial-02-cs.aspx.
The url should be something like http://localhost:xxxx/PersonalInformation (where xxxx is your port number)
To avoid getting this error everytime you start up your website through Visual Studio. Go to the properties of your web project and under the Web tab there is a property called Start URL. Change this to http://localhost:xxxx/ or something that is a valid MVC route.
Are you deploying to Cassini or IIS 6. Take a look at these articles
http://guyellisrocks.com/coding/deployed-asp-net-mvc-app-gives-404-on-about-page/
http://www.techdreams.org/microsoft/aspnet/how-to-fix-404-errors-of-aspnet-mvc-website-deployed-on-iis-6-windows-server-2003/2572-20090515
MVC runs fine in Cassini but requires some config modifications to run in IIS. I am still evaluating it in Cassini so i havent crossed that bridge yet but this info should help.

Security error when doing a post from a flash application to an Asp.Net MVC application

Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://mysite.com/Content/MyFlashApp/myflash.swf cannot load data from http://www.mysite.com/Home/SaveData.
at Main/encodeAndSave()
This post says that the problem can be caused by the wrong path being specified on the server side. You don't give a whole lot of information with your question - is this the problem you're having?
Other options from the same post are:
Trying to upload a file that is too big
Invalid filenames (e.g. containing an apostrophe)
A proxy server messing with the upload
When doing a Post to a web app from a flash app, you must specify the URLRequest's server path to be the exact same as what you're on.
If you specify:
http://www.mysite.com
http://mysite.com throws the security error above.
see here for more details on cross-domain security issues and how to resolve them.

Views does not open in live MVC application

After I published my application none of links works in web site except default.aspx. When I clicked them "page not found" is shown. I guess, it is about routing. But I did not do any change on default mvc routing settings. What could cause this kind of thing?
Thanks.
Verify that IIS which hosts your published web site has all the correct settings to run ASP.NET MVC (see this for on how to set up IIS 6 and this for IIS 7).
One would need more details to debug the issue. On a quicker note, first check for server logs (IIS/Apache) - it would indicate whether the request reached the server or not, where was the requested routed to, who processed it and what happened. Also check for server error logs.

Resources