Bug 14327 - when adding new target , it doesn't compile
Summary: when adding new target , it doesn't compile
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.8.x
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2013-08-29 11:26 UTC by Razvan Pascalau
Modified: 2014-07-28 17:33 UTC (History)
1 user (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:
RESOLVED INVALID

Description Razvan Pascalau 2013-08-29 11:26:15 UTC
System description:

------------------------------------------------------------------------------------------
Xamarin Studio
Version 4.0.12 (build 3)
Installation UUID: 387e94c5-a2e0-442c-ac0c-4b4969e79c02
Runtime:
	Mono 3.2.1 ((no/f3f789e)
	GTK 2.24.20
	GTK# (2.12.0.0)
	Package version: 302010001

Xamarin.Android
Version: 4.8.1 (Business Edition)
Android SDK: /Users/rpascalau/Library/Developer/Xamarin/android-sdk-mac_x86
	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)
Java SDK: /usr
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

Apple Developer Tools
Xcode 4.6.3 (2068)
Build 4H1503

Xamarin.Mac
Xamarin.Mac: Not Installed

Xamarin.iOS
Version: 6.4.3.0 (Business Edition)
Hash: 0068990
Branch: 
Build date: 2013-13-08 05:24:39-0400

Build Information
Release ID: 400120003
Git revision: 593d7acb1cb78ceeeb482d5133cf1fe514467e39
Build date: 2013-08-07 20:30:53+0000
Xamarin addins: 25a0858b281923e666b09259ad4746b774e0a873

Operating System
Mac OS X 10.8.4
Darwin mini_razvan.local 12.4.0 Darwin Kernel Version 12.4.0
    Wed May  1 17:57:12 PDT 2013
    root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64
------------------------------------------------------------------------------------------

I've created a new target in our project, but the new target would not compile, the main project .dll could not be found. I've manged to fix this by moving 
---------------------------------------------------------------------------------------------------------------
 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MyNewTarget|AnyCPU' ">
    <Optimize>false</Optimize>
    <OutputPath>bin\MyNewTarget</OutputPath>
    <WarningLevel>4</WarningLevel>
    <AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
  </PropertyGroup>
---------------------------------------------------------------------------------------------------------------
in the middle of the other targets (it was at the end of the .csproj file initially). I've tested this project file on windows and mac os x and it didn't work on either of them.
Comment 1 Jonathan Pryor 2014-07-28 17:33:58 UTC
This is how MSBuild works. <PropertyGroup/> declarations must come _before_ any <Import/>ed .targets files which use those <PropertyGroup/>s.

Any "overridden" <Target/>s must _follow_ any <Import/>ed .targets files which define those targets.