none
Visual Studio does not detect .NET Framework 4

    Question

  • Hello, I have installed Visual Studio 2010 Professional, which also installed .NET Framework 4.

    When I try to create a new project, it only gives me the option to use Frameworks 2, 3 and 3.5 . v4.0 does not appear on the drop down list.

    Also, when I try opening a .NET Framework 4 project I get the "this project is targeting ".NET Framework=v4.0"" error.

    I've used the tool to see if .NET Framework 4 is correctly installed, and it is!

    I don't understand, I've uninstalled and installed Framework 4 and VS2010 a thousand times, clean installs and all and VS still does not detect that Framework 4 is installed. I've also tried installing the standalone version of Framework 4, but no dice. Please help, I'm desperate!

    My system is Windows 7 x64 Home Premium, 8g ram, intel i7...

    Thanks!

    • Edited by BenSilva Wednesday, October 20, 2010 5:25 PM
    Wednesday, October 20, 2010 2:20 PM

Answers

  • Thanks for the help everyone, but the only solution that fixed my problem was formatting and reinstalling Windows and VS 2010. There was something really messed up with the registry keys, .NET installed successfully but the reg keys did not, didn't matter how many times i tried.
    • Marked as answer by BenSilva Tuesday, November 9, 2010 3:43 PM
    Tuesday, November 9, 2010 3:42 PM

All replies

  • Hello,

    Did you install the x64 version of the .NET Framework 4.0 or the x86? If I'm not mistaken, I think Visual Studio 2010 is only x86, so if you did download the x64 bit version of the .NET framework 4.0, it may not be able to see it...


    Ankit
    Wednesday, October 20, 2010 2:53 PM
  • Thanks for the response AnkitMathur, but I used the dotNetFx40_Full_x86_x64.exe standalone installer. So I think it should have installed both?

    Plus, the Visual Studio 2010 installer should have installed whatever .NET Framework 4 version it needs, no?

     

    Wednesday, October 20, 2010 4:14 PM
  • Hi BenSilva,

     

    Thank you for your post.

     

    Based on your description, I would recommend you could try the following suggestions.

     

    At first, please double check whether ALL versions of .NET Framework are installed correctly on your machine or not. I would recommend that you could use .NET Framework Verification Tool to verify it. Please download: http://blogs.msdn.com/b/astebner/archive/2008/10/13/8999004.aspx

     

    Then, if it succeed, please check whether Visual Studio 2010 works well or not. If not, please download Collect Tool to collect .NET Framework installation file to be convenient for analyzing your issue. Please download: http://blogs.msdn.com/b/astebner/archive/2007/08/01/4172276.aspx

     

    The third, if it still doesn’t work, I would recommend that you should uninstall Visual Studio 2010 thoroughly via Add/Remove Program and reinstall it again.

     

    If you have any issues, please feel free to tell me.

    CHEERS,

    Larcolais


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, October 22, 2010 3:42 AM
  • Bumb

    I am getting the same error!

    Only difference is I am on vista x64

    Tuesday, November 9, 2010 3:37 PM
  • Thanks for the help everyone, but the only solution that fixed my problem was formatting and reinstalling Windows and VS 2010. There was something really messed up with the registry keys, .NET installed successfully but the reg keys did not, didn't matter how many times i tried.
    • Marked as answer by BenSilva Tuesday, November 9, 2010 3:43 PM
    Tuesday, November 9, 2010 3:42 PM
  • Ok I'm glad I did not do what BenSilva did. Instead of repairing .net again and again I just decided to uninstall .net 4 and VS 2010. I let my copy of VS 2010 install .net 4 instead of the standalone net. 4 installer and it worked.

    Before I installed VS 2010 i already had .net 4 I guess somehow VS 2010 just acted funny for me because .net 4 was already installed instead of being installed with the VS 2010 installer.

    • Proposed as answer by hazzik Monday, May 13, 2013 8:51 AM
    • Unproposed as answer by hazzik Monday, May 13, 2013 8:51 AM
    Tuesday, November 9, 2010 5:32 PM
  • I tried that. I did everything, I installed and uninstalled VS2010 and .NET Framework 4. I let VS install .NET...i installed the standalone .NET...literally nothing worked for me.

    Glad you fixed it though, cheers!

    Tuesday, November 9, 2010 5:43 PM
  • Same problem here ... but I could fix it with: Downloading and starting "Windows Phone Developer Tools" ... after the first installation process is finished (.net4 Multi-Targeting...) i stopped the installation process and then restarted VS2010 and ... it found the .net4 Framework. (Yes, i tried to uninstall/reinstall all frameworks and vs2010 several times, but nothing else worked here. Win7/64bit)
    • Proposed as answer by Xander Hyde Sunday, January 9, 2011 1:51 AM
    Sunday, January 9, 2011 1:50 AM
  • For what its worth I might have found a work around. I went over the suggestions here and then some. I broke out repackaging tools, hacked up some msiexec for individual components, a little processexp.....even did some registry difference compare. Even ran a pass of SFC with no results.

    Even after all of I can't say that i know exactly what it is that is messed up - but I tell you it is isolated to the Windows Profile (current user). In my case i was able to create a new Windows account and all was good.

    That means that the .Default profile in the registry is clean and could be used - if I knew just what was broken. I am devving on an all-in-one virtual machine running 2008 R2 server so removing net3.5.1 was not an option for me or i'd lose my server.

    If you had the time you could export out elements of .Default or the new profile and import into the broken account. Or you can do the simpler thing and just back up your files, create new account as admin and restore. Or if you really needed that account name just delete your old local profile and when you log back in Windows will make you a new one.

    Your mileage may vary but in my case it was not the components - it was the profile.

    Wednesday, February 9, 2011 8:32 AM
  • One other thing that complicated my testing and made the whole process longer - several of my projects in my dev area are for SharePoint. I did see the frameworks missing initially in my winforms for sure but as i was troubleshooting i was occasionally opening a SharePoint project. SharePoint 2010 templates are forced to v3.5.

    Not sure if that helps

    Wednesday, February 9, 2011 9:14 AM
  • Same problem here ... but I could fix it with: Downloading and starting "Windows Phone Developer Tools" ... after the first installation process is finished (.net4 Multi-Targeting...) i stopped the installation process and then restarted VS2010 and ... it found the .net4 Framework. (Yes, i tried to uninstall/reinstall all frameworks and vs2010 several times, but nothing else worked here. Win7/64bit)

    This is what worked for me

    Same as everyone else tried uninstalling everything and reinstalling nothing helped and this was a brand new install of 7 ultimate but installing the windows phone developer tools fixed it.

    I think it is just the multi-targeting platform package

     


    www.wi-tek.net
    Thursday, June 16, 2011 4:25 PM
  • Same problem here ... but I could fix it with: Downloading and starting "Windows Phone Developer Tools" ... after the first installation process is finished (.net4 Multi-Targeting...) i stopped the installation process and then restarted VS2010 and ... it found the .net4 Framework. (Yes, i tried to uninstall/reinstall all frameworks and vs2010 several times, but nothing else worked here. Win7/64bit)
    Worked like a charm, thanks.
    Wednesday, February 22, 2012 8:52 AM
  • Even after all of I can't say that i know exactly what it is that is messed up - but I tell you it is isolated to the Windows Profile (current user). In my case i was able to create a new Windows account and all was good.

    Thanks loudsound. Your tip inspired me to find solution for my problem. I didn't know why my Visual Studio 2010 C# stop showing Framework 4 profile. All day I tryed to uninstall/install VS and Net4 but without any positive results. After reading your info I checked enviroment paths in my profile. I've found that I have "ProgramFiles(x86)" enviroment variable. I have 32-bit windows XP, so maybe some application added it accidentally because it is only for 64-bit systems. I removed it and now VS2010 works fine with Net4 :)

    So my tip is to check all enviromental variables like TEMP, TMP, PATH etc. Maybe VS chcecks one of them and stops when the path is not exist. Also maybe user profile name has some firbidden chars. It's not a solution for all, but may help someone.


    • Edited by asier70 Tuesday, April 3, 2012 7:49 AM
    Tuesday, April 3, 2012 7:47 AM
  • Same problem here ... but I could fix it with: Downloading and starting "Windows Phone Developer Tools" ... after the first installation process is finished (.net4 Multi-Targeting...) i stopped the installation process and then restarted VS2010 and ... it found the .net4 Framework. (Yes, i tried to uninstall/reinstall all frameworks and vs2010 several times, but nothing else worked here. Win7/64bit)

    This one worked for me too !! You made my day !!! ... Before this, I tryed anything, from reinstalling .net framework, re-applying sp1, re-installing the multi targeting. Also I tried installing the .net updates to 4.0.2: nothing.

    The ".net verifier" utility always told me everything was ok, but under VS2010 still I didn't have the framework 4 correctly available. I then finally just installed the "Windows Phone SDK 7.1" as you suggested, but I DID NOT STOPPED THE INSTALLATION PROCESS: it downloaded near 500MB of other things, and right after the installation I rebooted.

    Then ... magically now I have under VS2010 both "framework 4" and "framework 4.0.2" and everything is working again !! Many many thanks !

    p.s. the Windows Phone SDK 7.1 file is available here: http://www.microsoft.com/en-us/download/details.aspx?id=27570

    Thursday, August 23, 2012 9:32 AM
  • Hello! I had the same problem and I resolved it. I found out that there were no file "FrameworkList.xml" in folder "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\RedistList". But I noticed this file in machine where .Net Framework 4 is accessible from VS 2010. Then I copied this file to my computer and restarted VS 2010. And .Net Framework 4 appeared from drop down list.

    Hope this helps.

    • Proposed as answer by Dan Lien Friday, January 8, 2016 9:36 PM
    Tuesday, October 22, 2013 4:21 PM
  • excellent find. That saved us some reinstalls! Thank you ;-)

    Thursday, November 7, 2013 10:48 AM
  • Tahnk you for your help. Now it works! :-)
    Monday, February 3, 2014 8:12 AM
  • Worked a treat..... thanks
    Thursday, June 12, 2014 9:35 AM
  • I having the exactly same problems guys! But I'm using Windows Server 2008 R2 and apparently SDK is not supported in this environment ... i think i got stuck here 
    Tuesday, July 29, 2014 12:57 AM
  • I'm having this issue as well and it's really frustrating.  I'm running VS 2010 and 2012 and the issue is occurring in both.  I tried the Windows Phone dev kit installation and that didn't fix.  I'm currently running the .net framework repair tool and it instructed me to re-install the failing framework or update.  I just un-installed everything .NET 4.5 related and now I'm re-installing the developer package.  We will see what happens.  I'm running Win 7 Enterprise with all of the latest Windows updates as of 9/15/2014.  With as old as this issue is, you' would think MS would have addressed it by now.



    Monday, September 15, 2014 2:11 PM
  • Hallelujah! I finally have this 'mostly' working!  VS 2012 now recognizes .NET 4.5.1 & 4.5.2.  I'm sorry to say that I'm not sure exactly what fixed it however, my guess was running the .NET repair tool to de-register/re-register the windows installer service, then subsequently installing .NET 4.5.1 & 4.5.2 the dev tools.  This also resolved other annoying errors I was getting where VS was reporting that projects were targeted at .NET 4.5, however 4.5 wasn't installed on my machine (even though it really was, and the app itself would work just fine).


    Monday, September 15, 2014 3:41 PM
  • Dooood, you saved me so much trouble.  Bless you - LOL.
    Wednesday, October 8, 2014 12:36 AM
  • Excellent tip, as this file really seems to tell VS2010 of the presence of .NET 4.

    For me, the corresponding error message ("this project is targeting ".NET Framework=v4.0"" error) was gone after restoring this file.

    Sadly, my VS2010 still could not compile for .NET 4, complaining about many namespaces not being present. But this I could solve with executing the repair option of the VS2010 installer.

    My 1001st reason to get into this situation:

    Deinstallation of VS2015

    This guy seems to have deregistered all .NET 4.0 dlls from the GAC, while deleting the FrameworkList.xml file, but without really deinstalling the .NET Framework 4.0 from the machine (for me the .NET 4.0 installer always told it is installed already and refused to do any actions...)


    Wednesday, October 28, 2015 12:27 PM
  • Excellent solution. Thanks
    Monday, May 15, 2017 3:52 AM
  • Thank you very much. Great help for me.
    Wednesday, July 19, 2017 7:36 AM
  • Excellent!!!
    Wednesday, February 13, 2019 3:43 PM