Skip to main content

ASP.NET MVC2 and IIS 7.5 deployment issue

After spending hours and pulling my hair out over the deployment error , i finally found a solution, but before i talk about the actual solution, i will provide some context to the underlying problem. 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.

The link between .NET framework (any version) 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:\Windows\Microsoft.Net\Framework (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.

Comments

Popular posts from this blog

Upload to AWS S3 from Java API

In this post, you will see code samples for how to upload a file to AWS S3 bucket from a Java Spring Boot app. The code you will see here is from one of my open-source repositories on Github, called document-sharing. Problem Let’s say you are building a document sharing app where you allow your users to upload the file to a public cloud solution. Now, let’s say you are building the API for your app with Spring Boot and you are using AWS S3 as your public cloud solution. How would you do that? This blog post contains the code that can help you achieve that. Read more below,  Upload to AWS S3 bucket from Java Spring Boot app - My Day To-Do (mydaytodo.com)

Addressing app review rejections for auto-renewing subscription in-app purchase (iOS)

The ability to know what the weather is like while planning your day is a feature of  My Day To-Do  Pro and as of the last update it’s also a part of the  Lite version . Unlike the Pro version it’s an auto-renewing subscription based  in-app purchase (IAP)  in the Lite version. What means is that when a user purchases it, the user only pays for the subscription duration after which the user will be automatically charged for the next period. Adding an  auto-renewing  subscription based IAP proved to be somewhat challenging in terms of the app store review i.e. the app update was rejected by the App Review team thrice because of missing information about the IAP. Therefore in this post I will share my experiences and knowledge of adding auto-renewing IAP in hopes to save someone else the time that I had to spend on this problem. In-App purchase This year I started adding IAPs to My Day To-Do Lite which lead to learning about different types of IAP...

Getting started with iOS programming using Swift (Part 1)

I have not been too fond of Objective-C, which was the primary reason for me to stay away from making iOS apps till now. So what changed? Well Apple has done something very interesting recently and that is the introduction of a new programming language i.e. Swift. Swift is awesome, it almost feels like Python, C++ and Objective-C had a baby with some of their good parts in them. So I have been getting to know Swift and it is an awesome language to program in. What I am going to share with this and a series of blog posts are solutions to some problems that i have encounter while i am trying to finish my first iOS app. The one hurdle that I have encountered while getting started on developing an iOS app is that a majority of the solutions for iOS specific problems provide solutions to them using Objective-C. Which is fair, because Swift has not been around for that long. Anyway let us get started with a few basics, A few basics I would highly recommend having a read of this book...