After spending hours over the deployment error, I finally found a solution, but before talking about the solution, let’s have some context in to ASP dot NET MVC and IIS. I have recently developed an ASP.NET application using the MVC2 framework and when i tried to deploy the application on IIS i encountered a deployment error.

ASP dot NET MVC and IIS

This is the least visible problem of them all, because you are most likely to assume that this has already been taken care of. This is not an issue if IIS is installed before the .NET framework, however  if IIS is uninstalled or installed after the .NET framework has been installed than it does not automatically establish the link between the two . In case of the latter the issue can be resolved by manually establishing the link between IIS by the following steps
start the command prompt and navigate to the directory where you have installed the ASP.NET framework
e.g. cd  C:WindowsMicrosoft.NetFramework (the full name of the folder will determine the version number)
and run the following command aspnet_regiis –i
This should install the .NET framework and establish the link between IIS as well as .NET framework 4.0.

Application pool pointing to the wrong framework

When you create a new website IIS 7.5 creates an application pool with the same name as the website, by default IIS 7.5 assigns 2.0 as the target .NET framework. In order for an MVC application to work, it must point to .NET framework 2.0.
In order to change the target framework
  1. Right-click the application pool
  2. select advanced settings
  3. In the general tab and change the .NET framework version to 4.0

Web application unable to access the database error

This error stems from the fact that Identity is set to the default ApplicationPoolIdentity, in order to resolve this issue change the Identity to Local System or a custom account which has the permission to access the database.

Get updates?

If you find any of my posts useful and want to support me, you can buy me a coffee :)

https://www.buymeacoffee.com/bhumansoni

Or you can  buying or even try one of my apps on the App Store. 

https://mydaytodo.com/apps/

In addition the above, have a look at a few of the other posts,
How to create radio buttons using vanilla Javascript
https://mydaytodo.com/vanilla-javascript-create-radio-buttons/

How to build a Javascript frontend for Java Spring Boot backend 
https://mydaytodo.com/java-spring-boot-vanilla-javascript-solution/

Or have a look at some useful Javascript tutorials below
https://mydaytodo.com/category/javascript/

0 Comments

Leave a Reply

Avatar placeholder
Verified by MonsterInsights