Bug 38008 - [iOS][TFS] Asset Catalog and assets added to Asset Catalog not automatically added to .csproj file
Summary: [iOS][TFS] Asset Catalog and assets added to Asset Catalog not automatically ...
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 4.0.0 (C6)
Hardware: PC Mac OS
: High blocker
Target Milestone: 4.3.0 (C9)
Assignee: Emanuel
URL:
Depends on:
Blocks:
 
Reported: 2016-01-25 19:27 UTC by Jon Goldberger [MSFT]
Modified: 2016-12-09 15:04 UTC (History)
11 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 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 Jon Goldberger [MSFT] 2016-01-25 19:27:09 UTC
## Description:

This is a multi part issue but all likely related so filing together. Description from customer:

========
The issue seems to be related to the fact that we need to include the asset catalog and assets into the project in order to check them in to our source control system, TFS.

1. When creating a new Project and adding an Asset Catalog, the catalog Content.json is not automatically added to the project, so won't get checked in to TFS,
2. When adding image assets to the catalog, they are not automatically included in the project so they won't get checked in to TFS.
3. When including image assets to the project, they are added to the project file with the tag <InProject>false</InProject>. As a result they will be excluded again from the project next time you load the solution. This has another consequence: For other developers checking out the project the iOS project files will be automatically marked as modified, which may cause merge issues for larger projects.
4. Next time you load the project, asset catalog and images are excluded again. Not only that but you also have duplicate entries for the asset catalog Content.json in the project file.
5. In addition, we have the issue that these duplicates are not being cleaned up from the iOS .csproj project file when the items are deleted from within the VS project Asset Catalog area.
6. When deleting an asset catalog, the entries are not removed from the iOS project file.
=========

My observations: 
1 and 2: I was able to confirm 1 and 2, but noted that if I "Save All" from the file menu then the .csproj file is updated to include the Content.json files and the image files. Also the .csproj file is updated when the solution is closed and you choose to save any unsaved files. 

3 and 4: I did confirm the flag <InProject>False</InProject> being added, but the images were still present in the project and in the .csproj file after closing and opening the solution. Also I did not see the duplicate entries on my end. 

5: Never got the duplicates, so could not confirm this. 

6: I do see this, but again the .csproj file is updated when "File->Save All" is used. 


## Steps to reproduce

1. Create a new iOS project in Visual Studio 

2. Add an Asset Catalog to the project.

Expected result: Contents.json file will be added to an ItemGroup in the .csproj file.

Actual Result: Contents.json file is not added to the .csproj file until "File->Save All" menu is used. 

3. Add an image to the Asset Catalog.

Expected result: Image file will be added to an ItemGroup in the .csproj file.

Actual Result: Image file is not added to the .csproj file until "File->Save All" menu is used. 
Also note that the <InProject>False</InProject> flag is set for the image file in the .csproj file. 

4. Delete the Asset Catalog

Expected result: Contents.json and image files will be removed from the .csproj file.

Actual Result: Contents.json and image files are not removed from the .csproj file until "File->Save All" menu is used. 


## Notes

I tested using the Current Stable channel (C6 SR0) but customer reported this while using the Alpha channel (C6 SR1)

Environment info for both my set up and customer's set up below. 


## Environment

From customer :

Microsoft Visual Studio Professional 2013

Version 12.0.40629.00 Update 5

Microsoft .NET Framework

Version 4.5.51209


 

Installed Version: Professional


 

LightSwitch for Visual Studio 2013   06177-004-0447006-02239

Microsoft LightSwitch for Visual Studio 2013


 

Team Explorer for Visual Studio 2013   06177-004-0447006-02239

Microsoft Team Explorer for Visual Studio 2013


 

Visual Basic 2013   06177-004-0447006-02239

Microsoft Visual Basic 2013


 

Visual C# 2013   06177-004-0447006-02239

Microsoft Visual C# 2013


 

Visual C++ 2013   06177-004-0447006-02239

Microsoft Visual C++ 2013


 

Visual F# 2013   06177-004-0447006-02239

Microsoft Visual F# 2013


 

Visual Studio 2013 Code Analysis Spell Checker   06177-004-0447006-02239

Microsoft® Visual Studio® 2013 Code Analysis Spell Checker


 

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.


 

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.


 

Application Insights Tools for Visual Studio Package   1.0

Application Insights Tools for Visual Studio


 

ASP.NET and Web Tools   12.5.60612.0

Microsoft Web Developer Tools contains the following components:

Support for creating and opening ASP.NET web projects

Browser Link: A communication channel between Visual Studio and browsers

Editor extensions for HTML, CSS, and JavaScript

Page Inspector: Inspection tool for ASP.NET web projects

Scaffolding: A framework for building and running code generators

Server Explorer extensions for Microsoft Azure Web Apps

Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure


 

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0

For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563


 

ASP.NET Web Frameworks and Tools 2013   5.2.30612.0

For additional information, visit http://www.asp.net/


 

Common Azure Tools   1.4

Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.


 

Microsoft Azure Mobile Services Tools   1.4

Microsoft Azure Mobile Services Tools


 

NuGet Package Manager   2.8.60723.765

NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.


 

Office Developer Tools for Visual Studio 2013 ENU   12.0.30626

Microsoft Office Developer Tools for Visual Studio 2013 ENU


 

PreEmptive Analytics Visualizer   1.2

Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.


 

SQL Server Data Tools   12.0.41012.0

Microsoft SQL Server Data Tools


 

Windows Phone 8.1 SDK Integration   1.0

This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.


 

Workflow Manager Tools 1.0   1.0

This package contains the necessary Visual Studio integration components for Workflow Manager.


 

Xamarin   4.0.1.37 (019d80f)

Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.


 

Xamarin.Android   6.0.0.41 (3192c79)

Visual Studio plugin to enable development for Xamarin.Android.


 

Xamarin.iOS   9.4.1.0 (dab1554)

Visual Studio extension to enable development for Xamarin.iOS.


## My environment

Microsoft Visual Studio Professional 2015
Version 14.0.23107.0 D14REL
Microsoft .NET Framework
Version 4.6.00079

Installed Version: Professional

Visual Basic 2015   00322-40000-00000-AA850
Microsoft Visual Basic 2015

Visual C# 2015   00322-40000-00000-AA850
Microsoft Visual C# 2015

Visual C++ 2015   00322-40000-00000-AA850
Microsoft Visual C++ 2015

Visual F# 2015 RC   00322-40000-00000-AA850
Microsoft Visual F# 2015 RC

Windows Phone SDK 8.0 - ENU   00322-40000-00000-AA850
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools   14.0.20626.0
ASP.NET and Web Tools

ASP.NET Web Frameworks and Tools 2013   5.2.30624.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.5
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GenerateUnitTest   1.0
Generates unit test code for methods in classes under test.

GitHub.VisualStudio   1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.2.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.50616.0
Microsoft SQL Server Data Tools

Visual Studio Tools for Universal Windows Apps   14.0.23309.00 d14oob
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Xamarin   4.0.0.1717 (1390b70)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.0.0.35 (d300845)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   9.3.99.33 (ea30b32)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 2 Jon Goldberger [MSFT] 2016-01-25 19:38:25 UTC
Additional note:

The described behavior differs from that in XS on the Mac. With XS, the .csproj file is updated as soon as an asset catalog is added, an image is added to the asset catalog, the asset catalog is deleted, or an image is deleted from the asset catalog. Also the images do not get the <InProject>False</InProject> flag added in the .csproj file. 

So in XS on the mac the behavior is as expected.
Comment 3 Brendan Zagaeski (Xamarin Team, assistant) 2016-03-18 01:03:59 UTC
I am working on filing individual bugs for a few different issues that can arise when using asset catalogs with TFS. Once I have filed all of those bugs and checked to make sure they cover all of the various behaviors described by this bug, I will list those bugs here for reference and then mark this bug as a duplicate of Bug 39750.
Comment 4 Emanuel 2016-11-08 14:11:27 UTC
This issue has been fixed in Cycle 7 and it's present in current bits, now the Assets are added to the csproj when saving the Asset Catalog, there's no need to "Save All" or save the csproj.