Bug 60880 - Android design-time intellisense gets deleted by IncrementalClean
Summary: Android design-time intellisense gets deleted by IncrementalClean
Status: RESOLVED DOWNSTREAM
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 4.8.0 (15.5)
Hardware: PC Windows
: --- blocker
Target Milestone: 15.6
Assignee: Gaurav Ganorkar
URL:
Depends on:
Blocks:
 
Reported: 2017-11-27 22:06 UTC by Jérémie Laval
Modified: 2018-02-08 19:09 UTC (History)
12 users (show)

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


Attachments
Logs for Bug60880 (4.41 KB, application/x-zip-compressed)
2017-12-05 13:47 UTC, Gaurav Ganorkar
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 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 DOWNSTREAM

Description Jérémie Laval 2017-11-27 22:06:34 UTC
Design-time intellisense creates a Resource.designer.cs file that is stored under the project `obj\Debug\designtime` directory. When constructing the list of Compile file for intellisense, that file is used instead of the other Resource.designer.cs file that is in the project and is generated fully by AAPT.

Issue: when you build the project normally, the design-time Resource.designer.cs file gets deleted by MSBuild IncrementalClean target and because intellisense doesn't know about the full Resource.designer.cs file intellisense from then on is completely borked. Because there is no way to know when a design-time build is run to potentially re-create the file I have no idea how to un-bork this.

Screencast: https://www.screencast.com/t/RapdqU5K9sQ
Comment 1 dean.ellis 2017-11-28 10:47:56 UTC
I'll take a look and see if we can get the file added to the FileWrites item group so it does not get deleted.
Comment 2 dean.ellis 2017-11-28 14:10:18 UTC
Work in Progress PR https://github.com/xamarin/xamarin-android/pull/1052
Comment 5 Gaurav Ganorkar 2017-12-05 13:47:28 UTC
Created attachment 25914 [details]
Logs for Bug60880

This issue is getting Reproduced whenever we try to Rebuild the solution. Rebuilding the solution is deleting the AndroidDesignTime folder

Steps 

1-Create Single View android application
2-Build the solution
3-Open Project in  Solution explorer and Check AndroidDesignTime Folder contains "Resource.Designer.cs" (App\obj\Debug\designtime)
4-Now Rebuild the solution and Observe the intellisense error  pad 

Actual
- After rebuilding the solution i am still getting "[Failure] Could not find file 'C:\Users\User\source\repos\App39\App39\obj\Debug\designtime\Resource.Designer.cs'.
"

Screencast link-
https://www.screencast.com/t/Gy3s90jaRj

For this bug verification i have taken the d15-5 Preview 5 build and Xamarin.Android Version 8.1.1.1  (5d942bd12)

Build info-
Microsoft Visual Studio Enterprise 2017 
Version 15.5.0 [27129.1.d15rel]
VisualStudio.15.Release.Int/15.5.0+27129.1.d15rel
Microsoft .NET Framework
Version 4.7.02046

Xamarin   4.8.0.752 (4a1f0ea)
Xamarin Designer   4.8.182 (76aa1723e)
Xamarin.Android SDK   8.1.1.1 (HEAD/5d942bd12)
Xamarin.iOS and Xamarin.Mac SDK   11.4.0.214 (c4240f3)


Full build info- 
https://gist.github.com/parasAmbhore/d0da2bc6da986032cc9978d6be73a078

Logs are attached

Marking this defect as Reopened
Comment 6 dean.ellis 2017-12-05 14:16:03 UTC
There is an additional fix in Xamarin-android/master/2b4039a8 that probably should be cherry-picked to d15-5
Comment 7 dean.ellis 2017-12-05 14:40:09 UTC
my guess is rebuilding should be deleting the file... I am 100% sure if we left the design time folder in place after a Clean we would get a bug raised on it.
Comment 8 dean.ellis 2017-12-06 11:36:43 UTC
After chatting with the VS team. It seems that the design time build outputs should not be cleaned up by the clean target. They are usually left in the intermediate directory. 

So I guess we should remove the code which cleans that stuff up..
Comment 10 Jon Douglas [MSFT] 2017-12-14 19:28:36 UTC
Moving this milestone to 15.6 given 15.5.1 / 15.5.2 have already shipped and I'm unsure of the status of this bug(Feel free to change status and target milestone). There will be plenty of opportunity to get this in a 15.6 preview if it's not already fixed in master / d15.5.
Comment 11 Jacky Waswani 2018-01-11 08:00:56 UTC
Build Info: https://gist.github.com/GLjackyvaswani/df763b36faa8ed06e494b44911f58778


This issue is still getting Reproduced while Rebuild the solution. 

Actual
- After rebuilding the solution i am still getting "[Failure] Could not find file 'C:\Users\User\source\repos\App39\App39\obj\Debug\designtime\Resource.Designer.cs'."

Screencast: https://www.screencast.com/t/AMoh4gYz
Comment 12 dean.ellis 2018-01-11 11:04:44 UTC
@Jacky

I need to full diagnostic log of the Rebuild please. We need to find out what target is removing the file, since we removed the code which does it on a `Clean`.