Bug 45073 - Editing TargetFrameworkVersion in .csproj reverts when loading the project file
Summary: Editing TargetFrameworkVersion in .csproj reverts when loading the project file
Status: RESOLVED DUPLICATE of bug 53270
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 4.2.0 (C8)
Hardware: PC Windows
: Normal normal
Target Milestone: 4.3.0 (C9)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-10-05 18:08 UTC by John Miller [MSFT]
Modified: 2017-03-13 13:24 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 53270

Description John Miller [MSFT] 2016-10-05 18:08:50 UTC
**Overview**:

After editing the .csproj TargetFrameworkVersion element value, it will revert back to it's previous value when reloading the project.

**Steps to Reproduce**:

1. Create a new Android App in Visual Studio
2. Assuming the latest SDKs are installed, the TargetFrameworkVersion will be "v7.0" in the .csproj
3. Open the .csproj and edit the value to "v6.0" and save the file.
4. Reload the project

**Actual Results**:

The TargetFrameworkVersion is back to v7.0

**Expected Results**:

The TargetFrameworkVersion should be v6.0

**Build Date & Platform**:

Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Enterprise

Architecture and Modeling Tools   00322-80000-00000-AA000
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

Visual Basic 2015   00322-80000-00000-AA000
Microsoft Visual Basic 2015

Visual C# 2015   00322-80000-00000-AA000
Microsoft Visual C# 2015

Visual C++ 2015   00322-80000-00000-AA000
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU   00322-80000-00000-AA000
Windows Phone SDK 8.0 - ENU

ASP.NET and Web Tools 2015.1   14.1.20907.0
ASP.NET and Web Tools 2015.1

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.8.1   14.0.11123.0
Azure App Service Tools v2.8.1

Command Bus, Event Stream and Async Manager   Merq
Provides ICommandBus, IEventStream and IAsyncManager MEF services for loosely coupled Visual Studio extension components communication and integration.

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

Microsoft .NET Core Tools (Preview 2)   14.1.20907.0
Microsoft .NET Core Tools (Preview 2)

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

OptionsPackage Extension   1.0
OptionsPackage Visual Studio Extension Detailed Info

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.60519.0
Microsoft SQL Server Data Tools

TypeScript   1.8.36.0
TypeScript tools for Visual Studio

Xamarin   4.2.0.703 (3b7df6f)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.0.1.3 (96c7ba6)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.0.1.10 (ad1cd42)
Visual Studio extension to enable development for Xamarin.iOS.

**Additional Information**:

If you use the Project->Properties->Application menu and change the Compile using Android Version drop-down, it will save the change as expected.

The issue was reported here http://forums.xamarin.com/discussion/79582/targetframeworkversion-keeps-automatically-changing and is a problem when working with source control.
Comment 3 David Strickland 2017-03-12 21:08:35 UTC
Not sure how exactly this is "Resolved" The IDE is still making changes to source code that cant be undone or reverted. Your effectively stuck unless you actually want to commit your code.
Comment 4 Juan Marcelo Tondato 2017-03-13 13:24:38 UTC

*** This bug has been marked as a duplicate of bug 53270 ***