Bug 25933 - Default debug deployment attempts from XS will crash if the project has no TargetFrameworkVersion element in the csproj file
Summary: Default debug deployment attempts from XS will crash if the project has no Ta...
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Android Add-in ()
Version: 5.7
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: 5.7.1
Assignee: Greg Munn
URL:
Depends on:
Blocks:
 
Reported: 2015-01-12 13:05 UTC by Peter Collins
Modified: 2015-01-15 03:03 UTC (History)
3 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 or GitHub 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:
VERIFIED FIXED

Description Peter Collins 2015-01-12 13:05:29 UTC
Default debug deployment attempts from XS will crash if the project has no TargetFrameworkVersion element in the csproj file.

This will only manifest if the deployment configuration has enabled the "Use Shared Mono Runtime" option, which is true for Debug builds by default. Crash stacktrace will look something like - https://gist.github.com/pjcollins/71317053a7733cd8a91b

The default TargetFramework version has changed in XS 5.7 from v2.2 to v2.3, which was done in order to stay consistent with the changing default in XA 5.0. As a result of not shipping XA 5.0, we now have a mismatch in defaults - resulting in a slight variation of Bug #23982. One difference however is that AndroidUseLatestPlatformSdk does not need to be true in order for this issue to manifest now as a result of the mismatched default values.


> Users affected
Users with projects which do not contain a TargetFrameworkVersion element.
Users who select "Android 2.3 (Gingerbread)" as a Target framework in XS, as this will remove the TargetFrameworkVersion element from the csproj file.

> Known workarounds
Manually edit the .csproj file to include <TargetFrameworkVersion>vX.Y</TargetFrameworkVersion>
Select any Target framework in the XS drop-down _other_ than v2.3, as this will write a <TargetFrameworkVersion> element into the csproj file.
Comment 1 Greg Munn 2015-01-12 15:22:20 UTC
Fixed, awaiting merge

https://github.com/xamarin/md-addins/pull/319
Comment 4 Ram Chandra 2015-01-14 14:24:14 UTC
@Peter: Thanks for the steps.

I have checked this issue and I am able reproduce this issue with XA: 4.20.0.28.
To verify this issue I have checked this issue with following builds: 

Mac OS X 10.10.1
Xamarin Studio: 5.8 (build 207)
Runtime:
Mono 3.12.0 ((detached/a813491)
GTK+ 2.24.23 (Raleigh theme)
Package version: 312000068
Xcode 6.1.1 (6611)
Build 6A2008a
Xamarin.Android : 4.99.0.311 (Business Edition)
Android SDK: /Users/360_macmini/Desktop/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
=== Build Information ===
Release ID: 508000207
Git revision: 8750ddd3794d7817bc41e479951f00755dc9db9f
Build date: 2015-01-14 10:06:13-05
Xamarin addins: 0e980c35c87117d4a9a698adc5c9adc30ce2d269

Observation: When I removed the "TargetFrameworkElement" version from the .csproj and set the target framework to v2.3 and deploy application to the device. I observed that application is deployed successfully on device without andy error or exception.

This issue is fixed. Hence I am closing this issue.
Comment 6 Prashant manu 2015-01-15 03:03:52 UTC
We have checked again with stable XA and this issue is working fine.
Screencast: http://www.screencast.com/t/31BmqL1U7qN

Environment Info:
Xamarin Studio
Version 5.7.1 (build 4)
Installation UUID: 0b7eaebc-a0ed-4b58-81df-91e378cad28c
Runtime:
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

Xamarin.Android
Version: 4.20.0.28 (Trial Edition)
Android SDK: /Users/Admin_Mac/Desktop/Anddk/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

Apple Developer Tools
Xcode 6.1.1 (6611)
Build 6A2008a

Xamarin.iOS
Version: 8.6.0.52 (Business Edition)
Hash: 7c4c2c5
Branch: 
Build date: 2015-01-08 22:29:16-0500

Xamarin.Mac
Version: 1.12.0.3 (Business Edition)

Build Information
Release ID: 507010004
Git revision: b46fa13b30e60eb2318c06f2e320c76a5822b40c
Build date: 2015-01-14 17:48:56-05
Xamarin addins: 90f47f436cbffe4b2a158cb3c7b407d257400216

Operating System
Mac OS X 10.10.2
Darwin Admin-Macs-Mac-mini.local 14.1.0 Darwin Kernel Version 14.1.0
    Thu Nov 13 18:36:56 PST 2014
    root:xnu-2782.10.65~2/RELEASE_X86_64 x86_64