locked
Error - Invalid value for 'TargetFrameworkVersion'. RRS feed

  • Question

  • User1195 posted

    I have just updated to the latest version of Xamarin for Visual Studio. I have opened an existing project that needs a fix. When I tried to build the app I got the following error:- 'Error 4 Invalid value for 'TargetFrameworkVersion'. BudgetPlanner

    I have looked on Google and the forums for this error and it was suggested that I remove Xamarin and re-install from the direct download link.

    I have downloaded and installed v1.8.365.0.msi but still get the error.

    When I go to the properties of the project I it says Target Framework = Monotouch. I also have a class lib in the solution withe the same target framework.

    Thanks Ash..

    Wednesday, November 20, 2013 9:34 PM

Answers

  • User21626 posted

    I had this problem on iOS as well, and none of the posted fixes that I had seen would resolve this issue, so I posted details to Xamarin support. I received the following reply, which FIXED the issue (note I have modified the tags slightly so that they displayed in this post):

    If you open up the csproj file in your solution, does the following lines exist?:

    < PropertyGroup > < GenerateManifests >true< / GenerateManifests > < / PropertyGroup >

    If so, can you try either removing them or setting it to false to see if that resolves the issue?

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, November 22, 2013 1:50 PM

All replies

  • User25104 posted

    I am seeing this now as well. Any help would be great.

    Thursday, November 21, 2013 3:44 PM
  • User3192 posted

    Also having this issue.

    Thursday, November 21, 2013 9:29 PM
  • User13824 posted

    This error indicates a problem with the <TargetFrameworkVersion> element in the project's .csproj file. You can edit the .csproj file using a text editor.

    For Xamarin.iOS projects, you can try deleting the whole <TargetFrameworkVersion> element from the project file.

    For Xamarin.Android projects, you can ensure that the TargetFrameworkVersion matches one of your installed Android SDK versions. For example, for Android 4.3 Jelly Bean, you would see:

    <TargetFrameworkVersion>v4.3</TargetFrameworkVersion>
    
    Friday, November 22, 2013 12:25 AM
  • User21626 posted

    I had this problem on iOS as well, and none of the posted fixes that I had seen would resolve this issue, so I posted details to Xamarin support. I received the following reply, which FIXED the issue (note I have modified the tags slightly so that they displayed in this post):

    If you open up the csproj file in your solution, does the following lines exist?:

    < PropertyGroup > < GenerateManifests >true< / GenerateManifests > < / PropertyGroup >

    If so, can you try either removing them or setting it to false to see if that resolves the issue?

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, November 22, 2013 1:50 PM
  • User1195 posted

    Thanks Bill, that has fixed my problem!! How did I miss that from the helpful error message! Cheers Ash...

    Friday, November 22, 2013 9:35 PM
  • User818 posted

    I'm using VS2013, when I go to Project->Properties->Application (of a brand new project, the starting template) and try to change any of the Android versions (target,minimum,compile) I receive an messagebox with "Exception from HRESULT 0x8000FFFF E_UNEXPECTED". I notice that the VS csproj is missing the v4.3, but the Xamarin Studio one has it, so I copied, but still I can't change the other two (minimum/compile).

    Friday, November 22, 2013 9:57 PM
  • User43119 posted

    VS2010 The application is compiled on the simulator and the device, but when you try to publish, I immediately get the message: Invalid value for 'TargetFrameworkVersion'.

    After that, neither the device nor the simulator I can not run the application, keep getting this message until you remove it from the project file: true ... and so the circle. It's definitely a bug, and how to get rid of it - is not clear.

    P.S. All updates are installed.

    Tuesday, October 28, 2014 3:18 PM
  • User82058 posted

    I'm experiencing the same problem as Alexey, can we have a clue how to resolve this ?

    Thursday, November 20, 2014 10:11 AM
  • User55110 posted

    Same problem and billspain's solution fixed it. Thanks so much! May have spent a long time finding that one without your post...

    Monday, December 1, 2014 6:58 PM
  • User25720 posted

    Experiencing the same problem, even if billspain's solution fixes the build, « publish » recreates the tag in csproj / forces it to « true » and the error shows up again.

    Tuesday, December 30, 2014 11:34 AM
  • User109480 posted

    Same issue as Paul, he phrased it perfect " Experiencing the same problem, even if billspain's solution fixes the build, « publish » recreates the tag in csproj / forces it to « true » and the error shows up again."

    Paul ever find a solution?

    Saturday, February 21, 2015 12:55 AM
  • User80937 posted

    Did anyone find a solution for this? I am having the same issue as Wade and Paul. I remove the lines, but "publish" recreates the tag in csproj and the error shows up again.

    Wednesday, March 11, 2015 3:19 PM
  • User1195 posted

    @AnitaSheffield - Bills answer (second one down) was the one that solved my issue

    Wednesday, March 11, 2015 3:32 PM
  • User99695 posted

    I don't have "GenerateManifests" at all, but have some bug. Try to add line to project-file - this is don't help...

    Thursday, May 14, 2015 9:57 AM
  • User40038 posted

    After reverting to Xamarin Studio 5.8.3 (to get around problems caused by the 5.9 releases), I'm not seeing this problem when trying to build an Android project.

    /Users/danvanderboom/company/MyApp/MyApp.Android/MyApp.Android.csproj (Build) -> /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets (_SetLatestTargetFrameworkVersion target) ->

    /Users/danvanderboom/company/MyApp/MyApp.Android/MyApp.Android.csproj: error XA0001: Unsupported or invalid $(TargetFrameworkVersion) value of 'v4.0'. Please update your Project Options.

    I can create a new Android app from scratch, and that seems to work fine when I deploy to a device for testing. But when working on a client's project, I get the above error when trying to build it. My client has no problems building the same project, and we have confirmed we're on the same version of Xamarin Studio (5.8.3).

    Why is target framework 4.0 unsupported? Every time the solution is opened, Xamarin Studio asks if we want to upgrade the target framework. (I've been told to say no every time, to avoid other problems.)

    Is there an older version of Xamarin Studio that will support target framework 4.0?

    Saturday, May 23, 2015 1:26 AM
  • User113187 posted

    Thanks Bill, after I set true as false, everything go well!

    Friday, May 29, 2015 2:55 AM
  • User153262 posted

    if anybody got the solution .Please help me.i tried to set false.But when tried to publish the project valuechanged to true

    Saturday, August 29, 2015 6:07 PM
  • User95093 posted

    Hi, maybe toofar but nee jist delete this:

    true

    Saturday, October 24, 2015 4:31 PM
  • User219603 posted

    Just started getting this. I have no idea why. I'm running Visual Studio 2015. None of the values stated in this thread are located in my .csproj file in the iOS Project. First Xamarin project and probably my last. This is awful, dead in the water at this point and from what I can tell I didn't even do anything. It was building fine 1hr ago on all devices. Now I can't get it to work on the iOS Simulator or my Phone.

    Wednesday, May 4, 2016 8:09 PM
  • User103525 posted

    Thanks @billspain, That's fixes my issue.

    I got this issue when I tried to publish my iOS project from VS2015 with Mac build server. After that I can't run my iOS project to simulator and device.

    As @billspain said I changed that property into false. That fixed my issue.

    Hope It will be helpful to someone.

    Tuesday, May 24, 2016 1:55 PM
  • User34914 posted

    @TamilSelvanR - very same setup here, same issue, same solution as suggested by @billspain. Thank you so much!

    Thursday, May 26, 2016 11:26 AM
  • User210933 posted

    None of the solutions worked for me. Changing GenerateManifest to false, deleting it at all or deleting the <TargetFrameworkVersion> tag. For the first two solutions, it gets back as soon as I Publish. For the 3rd solution, the project stops "existing" on my solution and I have to right click on it and "install missing features". Once I do it, the tag is back.

    Friday, June 17, 2016 10:04 AM