Bug 7141 - Cannot build Android projects in Release mode
Summary: Cannot build Android projects in Release mode
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Android Add-in ()
Version: unspecified
Hardware: PC Mac OS
: Highest major
Target Milestone: ---
Assignee: Lluis Sanchez
URL:
Depends on:
Blocks:
 
Reported: 2012-09-13 10:08 UTC by Alan McGovern
Modified: 2012-09-18 11:26 UTC (History)
4 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:
RESOLVED FIXED

Description Alan McGovern 2012-09-13 10:08:27 UTC
There is an issue with MonoDevelops MSBuild host process where project configurations are not set correctly when being built. If we set the configuration as a global property, it ends up being stripped by one of the tasks in the microsoft msbuild targets files. The workaround is to set the configuration as a regular property and not a global property.

Here is the original bug report:


Environment: 

- Win 7 x64 (on Mac all works fine) 
- MonoDevelop 3.0.4.6 
- Microsoft .NET 4.0.30319.1 
- Mono for Android: 4.2.5 


Steps to reproduce: 

- Clone https://github.com/PVoLan/TestProjRef Here is a test monodroid project, with two monodroid library projects, referenced one another. 
- Make sure that all /bin and /obj folder are completely clean or deleted 
- Try to build solution in Release mode 
- While building Lib1.csproj you'll get an error (Pay attention that compiler tries to reference to Debug folder): 

C:\Work\Test\TestProjRef\Lib1\CSC: Error CS0006: Metadata file '%PROJ_PATH%\TestProjRef\Lib2\bin\Debug\Lib2.dll' could not be found (CS0006) (Lib1) 

- If you'll compile project into Debug mode, then rebuild into Release (without cleaning /bin & /obj), project will be build sucessfully, but Lib2.dll will used from previous debud build session. If you'll start application then, you'll find application output 

Lib2.SomeClass.DoSmth Debug mode 

Cause most of developers first use debug mode, and then build releases, this error is hard enough to detect and may be critical.
Comment 1 Alan McGovern 2012-09-13 19:54:33 UTC
lluis, could you review this commit and let me know if it's ok? It seems to do the job just fine.

https://github.com/mono/monodevelop/commit/3ac9ac5606e1944e951aec307f09f93ff4c97123
Comment 2 PJ 2012-09-13 20:02:18 UTC
The commit listed fixes the issue for me.

Test case also added.
Comment 3 Alan McGovern 2012-09-18 11:26:26 UTC
Commit has been reviewed and seems to be good. Closing the bug. This has already been released in MonoDevelop 3.0.4.7 aswell.

Thanks guys!