Troubleshooting: .Net 2.0 Setup requires .Net 4.0 Runtime

I recently came across this problem when I was attempting to create a setup project for one of my applications... I say attempting because I am not a developer but I like to amuse myself sometimes with some code here and there... So I have Visual Studio 2010 Beta 2 installed on my Windows 7 which by the way ROCKS!

I created the application.. I created the setup project ... fixed some minor issues and there... cleaned some code... and finally the build succeeds... and I have the application with me...

I test it on my machine and everything goes smooth and I love it... Now here's the thing... I run it on my server which by the way is running Windows Server 2008 and I receive the lovely pop-up as shown below:

I was very sure my projects were created with .Net Framework 2.0 in mind... I couldnt make out as to why it was asking for .Net 4.0? What I knew for sure was .Net 4 apps can be written with Visual Studio 2010. So it was time to open my code again... I check my code I check everything around to see if anything refers to .Net 4.0. Couldn't find any. I checked the properties of the helper project for the setup and it showed what I wanted to see:

.Net Framework 2.0 ... I knew I was missing something... so I go back to my setup project and check it again ... this time a bit more carefully and in consultation with some one (Harish Ranganathan)who has far more experience than me in writing code... and pretty soon enough we get to the Detected Dependencies view in the Setup Project which had .Net Framework as a dependency...I had seen that previously... Never cared much about it thinking that my project indeed needed the .Net Framework to work... What I had missed was the generalization...

Yes my project needed .Net 2.0 framework but that never explains the same generalization is going to be applied by VS 2010 now... is it?

That question was answered by the properties windows when checked for .Net dependency. Take a look:

My mistake couldnt be shown more clearly than this... :) Once I changed that to .Net Framework 2 everything's good...

Hope this helps...

No Comments