Bug 7387 - MonoTouch Library project "not built using active configuration"
Summary: MonoTouch Library project "not built using active configuration"
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Project Model ()
Version: 3.0.x
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: master
Assignee: Lluis Sanchez
URL:
Depends on:
Blocks:
 
Reported: 2012-09-21 11:57 UTC by cod3monk3y
Modified: 2017-08-25 18:12 UTC (History)
5 users (show)

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


Attachments
Images of missing project options. (532.88 KB, application/pdf)
2012-11-08 15:50 UTC, Andrew Way
Details


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 NOT_REPRODUCIBLE

Description cod3monk3y 2012-09-21 11:57:20 UTC
Step to Reproduce:
1. Launch MonoDevelop
2. Create a new solution
3. Create a new MonoTouch Library project "Lib"
4. Create a new iPhone Single View Application "App"
5. Create a new MonoTouch Library project "Lib2"
6. Add reference from "App" to "Lib" and "Lib2"
7. Change configuration to Debug|iPhone
8. Build

Actual result:
7. "Lib" not available in active configuration
8. Build failure, Lib.DLL not present.

Expected Result:
7. "Lib" available, since it is a valid 

Environment:
Mono Develop - 3.0.4.6

Additional Data:
Stack Overflow discussion: http://stackoverflow.com/questions/9311980/class-libraries-for-monotouch-projects-getting-not-built-using-active-configur/12533772#12533772

Workaround:
Manually edit the .sln file to add these lines (GUID for Lib is {A9A8...})

{A9A8640A-C650-46AB-A21C-DF3B5D22BAA3}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{A9A8640A-C650-46AB-A21C-DF3B5D22BAA3}.Debug|iPhone.Build.0 = Debug|Any CPU
{A9A8640A-C650-46AB-A21C-DF3B5D22BAA3}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{A9A8640A-C650-46AB-A21C-DF3B5D22BAA3}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU

{A9A8640A-C650-46AB-A21C-DF3B5D22BAA3}.Release|iPhone.ActiveCfg = Release|Any CPU
{A9A8640A-C650-46AB-A21C-DF3B5D22BAA3}.Release|iPhone.Build.0 = Release|Any CPU
{A9A8640A-C650-46AB-A21C-DF3B5D22BAA3}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{A9A8640A-C650-46AB-A21C-DF3B5D22BAA3}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
Comment 1 Mikayla Hutchinson [MSFT] 2012-09-24 15:11:27 UTC
FWIW, it's possible to work around this by removing the project from the solution and adding it back.
Comment 2 Andrew Way 2012-11-08 15:47:19 UTC
On Behalf of Isaac Eckert | FANUC Robotics

I discovered another problem.  After installing the beta version of MonoDevelop two days ago, some of my MonoTouch projects are no longer recognized as MonoTouch projects.  They still appear in the solution as projects but they no longer have MonoTouch build settings and they are not longer built as part of the iPhoneSimulation configurations.  I did not notice it because I was working with a smaller test application at the time.

(Please see attachment MonoTouch Project Options bug.pdf)
Comment 3 Andrew Way 2012-11-08 15:50:31 UTC
Created attachment 2886 [details]
Images of missing project options.
Comment 4 Jeffrey Stedfast 2013-02-27 22:20:37 UTC
I've hit this as well. It only happens when you create a Library Project first, and then add an App Project.

The reason seems to be because Library Projects don't have all of the same configurations that App Projects have.

All projects added after the first project seem to inherit the configurations from the first project, but not the reverse.

So when you add the App Project later and then decide you want to build "iPhone|App Store" (for example), the library project(s) that you added before the App Project don't have that configuration.



Lluis: any idea how to fix this?
Comment 5 Mikayla Hutchinson [MSFT] 2013-02-28 00:28:47 UTC
We probably need some logic so that when a new project or project configuration is added to a solution, we add it to existing solution configurations using heuristic similar to the ones we do when creating new solution configurations: https://bugzilla.xamarin.com/show_bug.cgi?id=6169#c11
Comment 6 Nicolas Raoul 2014-08-29 03:21:16 UTC
Reproduced without MonoTouch. Just a plain C# solution on Monodevelop 4.0.12 on Ubuntu 2014.04
Workaround suggested in comment 1 worked.
Cheers!
Comment 8 Will Smith 2017-08-25 18:12:30 UTC
Thanks so much for taking the time to submit this report! I attempted to reproduce this issue based on the bug description with the latest Visual Studio 2017 for Mac Preview version 7.2, and I was unable to hit the problem. If this issue is still occurring for you, please reopen this report and attach a reproduction, ideally starting with a new template project and then adding just the code necessary to demonstrate the issue.