Bug 39405 - Shared project, adding file and changing configuration results in invalid file list for iOS/Android... project
Summary: Shared project, adding file and changing configuration results in invalid fil...
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Project Model ()
Version: unspecified
Hardware: PC Mac OS
: High normal
Target Milestone: (C7)
Assignee: David Karlaš
URL:
Depends on:
Blocks:
 
Reported: 2016-03-07 11:50 UTC by David Karlaš
Modified: 2016-05-02 21:33 UTC (History)
4 users (show)

Tags: c7regression
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 David Karlaš 2016-03-07 11:50:26 UTC
Problem is `.projitems` in case of iOS and Droid projects(or any other .Net project referencing SAP) is imported here: https://github.com/mono/monodevelop/blob/cycle7/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs#L88
Which means static <Import …> but shared project imports it here: https://github.com/mono/monodevelop/blob/cycle7/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProject.cs#L115
This results in iOS/Droid having different msbuildproject(of .projitems) then shared project…
Problem appears if user adds new file to shared project and .projitems in shared project is updated(and saved https://github.com/mono/monodevelop/blob/cycle7/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProject.cs#L196) but version of iOS/Droid project is not updated(it’s different object) also it seems Imports loaded via `DefaultMSBuildEngine.LoadProject` don’t have concept of .Refresh()… problem appears if ActiveConfiguration is changed and iOS/Droid source files are reloaded since now they don’t include new files in .projitems...
Comment 1 David Karlaš 2016-03-07 12:00:11 UTC
Reproduction steps:
1) Create new Solution with Console Project(or any .Net project).
2) Add Shared project to solution.
3) Reference Shared project from Console Project
4) Add new file to SAP.
5) Change configuration to Release.
6) Try to type some code into new file, observe no code is added because TypeSystem is going crazy because Console Project doesn't have this file in file list.
Comment 2 David Karlaš 2016-04-12 14:55:09 UTC
PR against C7 opened: https://github.com/mono/monodevelop/pull/1363
Comment 3 xamarin-release-manager 2016-04-12 16:39:06 UTC
Fixed in version 6.0.0.4981 (cycle7)

Author: Lluis Sanchez
Commit: 3f26da92e30ab03b42ef3129ddda575f305dca77 (mono/monodevelop)
Comment 4 Lluis Sanchez 2016-04-13 14:00:36 UTC
*** Bug 40196 has been marked as a duplicate of this bug. ***
Comment 5 xamarin-release-manager 2016-04-13 16:19:00 UTC
Fixed in version 6.0.0.5016 (cycle7-hdpi-win32)

Author: Lluis Sanchez
Commit: 3f26da92e30ab03b42ef3129ddda575f305dca77 (mono/monodevelop)
Comment 6 Abhishek 2016-04-18 15:13:02 UTC
I have tried this issue and able to reproduce this issue at my end with the following build: XamarinStudio-6.0.0.4944_a689f869a720b116d1d8fb401e059ce840700641

Screencast: http://www.screencast.com/t/PYk2HFn1b1e

To Verify this issue. I have checked this issue with latest C7 build:
XamarinStudio-6.0.0.5044_89a1f5ab1d36cdc19f7e1b9b2a60a69a8a599b0d. I have followed the steps given in comment 1 and observe that this issue is working fine. Here is the screencast for the same: http://www.screencast.com/t/Pu03UlaAi

Hence closing this issue.

Thanks!
Comment 7 xamarin-release-manager 2016-05-02 21:33:37 UTC
Fixed in version 6.0.0.5118 (cycle7-android-n)

Author: Lluis Sanchez
Commit: 3f26da92e30ab03b42ef3129ddda575f305dca77 (mono/monodevelop)